SlideShare a Scribd company logo
1 of 50
Download to read offline
Dani Arnaout 
Systems Engineer at Lextech 
Introduction to Swift
1 Introduction
1 Introduction Introduction to Swift 
by Dani Arnaout 
$
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
queue 
1 Introduction Introduction to Swift 
by Dani Arnaout 
stack 
linked list 
tree 
graph
1 Introduction Introduction to Swift 
by Dani Arnaout 
Beirut Electricity
MacBook Pro + Xcode + iPhone 
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout 
Objective-C
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout 
Xcode
1 Introduction Introduction to Swift 
by Dani Arnaout 
Xcode
1 Introduction Introduction to Swift 
by Dani Arnaout 
stackoverflow.com
1 Introduction Introduction to Swift 
by Dani Arnaout 
Silly Apps
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout 
1 year later…
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout
1 Introduction Introduction to Swift 
by Dani Arnaout 
Academic Industrial
2 Swift
2 Swift Introduction to Swift 
by Dani Arnaout 
;
2 Swift Introduction to Swift 
by Dani Arnaout 
I. Data Types 
var x = 3 
var speedOfCar = 84.6 
var orangesAreOrange = true 
let maximumNumberOfSeasons = 4
var x = 3 
var speedOfCar = 84.6 
var orangesAreOrange = true 
let maximumNumberOfSeasons = 4 
2 Swift Introduction to Swift 
by Dani Arnaout 
I. Data Types 
let beeseh = "" 
let bobby = ""
2. Basic Operators 
2 Swift Introduction to Swift 
by Dani Arnaout 
unary: -a 
binary: a+b 
ternary: a?b:c
3. Strings 
2 Swift Introduction to Swift 
by Dani Arnaout 
var username = "Dani" 
let uselessString = "This is a totally useless string"
4. Collection Types 
2 Swift Introduction to Swift 
by Dani Arnaout 
Array: 
var shoppingList = ["Eggs", "Milk"] 
var firstItem = shoppingList[0] // Eggs 
Dictionary: 
var userInfo = [“name”:”Dani", “age”:”24"] 
var username = userInfo["name"] // Dani
5. Control Flow 
2 Swift Introduction to Swift 
by Dani Arnaout 
For: 
for var i = 0; i < 3; i++ { 
println("index is " + i) 
} 
For-in: 
for i in 0...2 { 
println("index is " + i) 
} 
// index is 0 
// index is 1 
// index is 2 
// index is 0 
// index is 1 
// index is 2
5. Control Flow 
2 Swift Introduction to Swift 
by Dani Arnaout 
While: 
var i = 0 
while i < 3 { 
println("index is ”+i) 
i++ 
} 
// index is 0 
// index is 1 
// index is 2
5. Control Flow 
2 Swift Introduction to Swift 
by Dani Arnaout 
If: 
if temperatureInCelsius < 15 { 
println("It's very cold. Consider wearing a scarf.") 
} else { 
println(“It's OK.”) 
}
5. Control Flow 
2 Swift Introduction to Swift 
by Dani Arnaout 
Switch: 
let temperatureInCelsius = 15 
switch temperatureInCelsius { 
case 15: 
println(“Cold”) 
default: 
println(“Meh”) 
}
6. Functions 
2 Swift Introduction to Swift 
by Dani Arnaout 
Define a function: 
func sayHelloWorld() { 
print(“Hello World”) 
} 
Call a function: 
sayHelloWorld() 
// Hello World
6. Functions 
2 Swift Introduction to Swift 
by Dani Arnaout 
Define a function: 
func sayHelloWorld() -> String { 
return “Hello World” 
} 
Call a function: 
print(sayHelloWorld()) 
// Hello World
6. Functions 
2 Swift Introduction to Swift 
by Dani Arnaout 
Define a function: 
func sayHello(personName:String) -> String { 
return "Hello " + personName + "!" 
} 
Call a function: 
print(sayHello("Dani")) 
// Hello Dani!
7. Classes 
2 Swift Introduction to Swift 
by Dani Arnaout 
class Rectangle { 
var width = 0 
var height = 0 
var hasBorders = false 
var color : String? 
}
2 Swift Introduction to Swift 
by Dani Arnaout 
?
3 Start Coding
3 Start Coding Introduction to Swift 
by Dani Arnaout
4 Xcode
4 Xcode Introduction to Swift 
by Dani Arnaout
5 Conclusion
5 Conclusion Introduction to Swift 
by Dani Arnaout 
Reference
5 Conclusion Introduction to Swift 
by Dani Arnaout
5 Conclusion Introduction to Swift 
by Dani Arnaout 
Q&A
Media Resources 
• Personal pictures 
• All Googled images are under usage right: Labeled for reuse 
Web Resources 
Software Used 
5 Conclusion Introduction to Swift 
by Dani Arnaout 
Resources 
• https://developer.apple.com/library/mac/documentation/Swift/Conceptual/Swift_Programming_Language 
• http://raywenderlich.com 
• https://github.com/raywenderlich/swift-style-guide 
• Keynote (6.5) 
• Xcode (6.1.1) 
• Reflector (1.6.5)
5 Conclusion Introduction to Swift 
by Dani Arnaout 
http://www.slideshare.net/DaniArnaout
5 Conclusion Introduction to Swift 
by Dani Arnaout 
@dani_arnaout

More Related Content

Similar to LAU ACM - Introduction to Swift - Dani Arnaout

LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year laterGiovanni Bechis
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to SwiftJohn Anderson
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific FilesystemVanessa S
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side SwiftJens Ravens
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAndrii Soldatenko
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side SwiftChad Moone
 
iOSNeXT.ro - 10 reasons you'll love Swift - Paul Ardeleanu
iOSNeXT.ro - 10 reasons you'll love Swift - Paul ArdeleanuiOSNeXT.ro - 10 reasons you'll love Swift - Paul Ardeleanu
iOSNeXT.ro - 10 reasons you'll love Swift - Paul ArdeleanuPaul Ardeleanu
 
Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Daniel Luxemburg
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfAdityamd4
 
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...melbats
 
Letswift Swift 3.0
Letswift Swift 3.0Letswift Swift 3.0
Letswift Swift 3.0Sehyun Park
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017Amy Cheong
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahNick Plante
 

Similar to LAU ACM - Introduction to Swift - Dani Arnaout (20)

LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year later
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
 
Devoxx 17 - Swift server-side
Devoxx 17 - Swift server-sideDevoxx 17 - Swift server-side
Devoxx 17 - Swift server-side
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific Filesystem
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
Swift initcopy
Swift initcopySwift initcopy
Swift initcopy
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environments
 
Practical presentation
Practical presentationPractical presentation
Practical presentation
 
Kotlin
KotlinKotlin
Kotlin
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
iOSNeXT.ro - 10 reasons you'll love Swift - Paul Ardeleanu
iOSNeXT.ro - 10 reasons you'll love Swift - Paul ArdeleanuiOSNeXT.ro - 10 reasons you'll love Swift - Paul Ardeleanu
iOSNeXT.ro - 10 reasons you'll love Swift - Paul Ardeleanu
 
Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)
 
Start with swift
Start with swiftStart with swift
Start with swift
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdf
 
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...
EclipseCon Europe 2013 - Turning Eclipse into an Arduino programming platform...
 
Letswift Swift 3.0
Letswift Swift 3.0Letswift Swift 3.0
Letswift Swift 3.0
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 

Recently uploaded

Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxKatherine Villaluna
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 

Recently uploaded (20)

Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 

LAU ACM - Introduction to Swift - Dani Arnaout