Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.74 KB

swift-data-types.md

File metadata and controls

58 lines (47 loc) · 1.74 KB

Swift 4 Data Types

  • Types
    • Named Types
      • Classes
      • Structures
      • Enumerations
      • Protocols
    • Compound Types
      • Function Types
      • Tuple Types

Structures

Enumerations

Protocols

Function Types

  • Examples:
    • () -> Void (is an alias of () -> ())
    • (Void) -> Void (is an alias of (()) -> (), different from above)
    • (Int) -> Int
    • (Int) -> (Int) -> Int (the same as (Int) -> ((Int) -> Int))

Tuple Types

  • Examples:
    • (Int, Int)
    • (Int, String)
    • (Int, Int, Int)