Swift Tutorial - Tutorialspoint

(backadmin) #1
ii

Table of Contents


About the Tutorial .................................................................................................................................. i

Audience ................................................................................................................................................ i

Prerequisites .......................................................................................................................................... i

Execute Swift Online............................................................................................................................... i

Disclaimer & Copyright ........................................................................................................................... i

Table of Contents .................................................................................................................................. ii


  1. SWIFT – OVERVIEW ............................................................................................................ 1

  2. SWIFT – ENVIRONMENT..................................................................................................... 2


Try it Option Online ............................................................................................................................... 2

Local Environment Setup ....................................................................................................................... 2


  1. SWIFT – BASIC SYNTAX ....................................................................................................... 6


Import in Swift ...................................................................................................................................... 6

Tokens in Swift ...................................................................................................................................... 6

Comments ............................................................................................................................................. 7

Semicolons ............................................................................................................................................ 7

Identifiers .............................................................................................................................................. 7

Keywords............................................................................................................................................... 8

Whitespaces .......................................................................................................................................... 9

Literals ................................................................................................................................................... 9


  1. SWIFT – DATA TYPES ........................................................................................................ 10


Built-in Data Types .............................................................................................................................. 10

Bound Values ...................................................................................................................................... 11

Type Aliases ......................................................................................................................................... 11

Type Safety .......................................................................................................................................... 12
Free download pdf