Programare swift Swift tutorial from tutorials point | Page 3
Swift 4
Table of Contents
About the Tutorial .................................................................................................................................... i
Audience .................................................................................................................................................. i
Prerequisites ............................................................................................................................................ i
Execute Swift 4 Online ............................................................................................................................. i
Disclaimer & Copyright ............................................................................................................................. i
Table of Contents .................................................................................................................................... ii
1. SWIFT 4 – OVERVIEW .......................................................................................................... 1
2. SWIFT 4 – ENVIRONMENT ................................................................................................... 2
Try it Option Online ................................................................................................................................. 2
Local Environment Setup......................................................................................................................... 2
3.
SWIFT 4 – BASIC SYNTAX ..................................................................................................... 6
Import in Swift 4 ..................................................................................................................................... 6
Tokens in Swift 4 ..................................................................................................................................... 6
Comments ............................................................................................................................................... 7
Semicolons .............................................................................................................................................. 7
Identifiers ................................................................................................................................................ 7
Keywords ................................................................................................................................................ 8
Whitespaces ............................................................................................................................................ 9
Literals .................................................................................................................................................... 9
Printing in Swift ....................................................................................................................................... 9
4.
SWIFT 4 – DATA TYPES ...................................................................................................... 11
Built-in Data Types ................................................................................................................................ 11
Bound Values ........................................................................................................................................ 12
Type Aliases .......................................................................................................................................... 12
ii