Skip to content

FullStack-Swift/swift-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Training

Declaring Constants and Variables

  • Use let to make a constant and var to make a variable
let double: Double = 3.14
// double = 3 // Error: You can't reassign a let
var number = 0
number = 1 // It's OK, You can reassign a var

Numeric Type Conversion

let int = 8 // int == Int
let double = 3.14 // double == Double

Strings

/// one line
let helloSwift = "Hello Swift!"
/// multi line
let hiThere = """
Hi
Swift!
"""

Control Flow

let value = 101
if value%2 == 0 {
  print("")
} else {
  print("")
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published