Swift

[Swift] Inheritance

Superclass and subclass parent class is super class child class is subclass child class can use all things of parent class single inheritance.

[Swift] Class

Property need the initial value. initial value Initialize to init optional variable, constant

[Swift] Loop

For loop for var i = 0; i < 10; i+=1 { print(i) } // error // C-style for statement has been removed in Swift 3 ```swift for i in 0..<10 { pri...

[Swift] Conditional

If var x = 10 if x > 5 { print("greater than 5") } If -else var x = 2 if x % 2 == 0 { print("even number") } else { print("odd number") }

[Swift] Data type

Data type basic Saving Numbers in a Swift Program var num : Int = 10 var num = 10 If there is an initial value as shown above, the com...

[Swift] Print

Print print(1, 2, 3, 4, 5) // 1 2 3 4 5 print(1, 2, 3, 4, 5, separator: "-") // 1-2-3-4-5 separator : print the string between each item