SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
Swift
Java < Scala < Swift
Java + Eclipse = COBOL
Scala + Idea = cool but tricky
Swift + Xcode = easy and fun
Let’s study Swift.
Swift
We r gonna study Swift with Playground.
Hello World
var str: String = “SWIFT”
println(“Hello (str) World”)
Type Inference
var list: String = “Hello World”
var list = “Hello World”
var obj: MyClass = MyClass()
var obj = MyClass()
noun: Inference

verb: Infer
reference report
?
var value: Optional<Int>
var value: Int?
? indicates that the value may contain nil.
func getValueThisMayReturnNil() -> String?
func getValueThisWillNotReturnNil() -> String
var ret = getValueThisWillNotReturnNil()
if ret != nil { // this does not make sense!
ret.doSometing()
func getValueThisMayReturnNil() -> String?
if let ret = getValueThisMayReturnNil() // Unwrappe if Some
{
ret.doSometing() // normal
} else {
// Nil
}
https://www.youtube.com/watch?v=KSkPE_-gBkc&index=4&list=PLy7oRd3ashWodnpf8rjfYEkTgwbOEsKfU&spfreload=1
!
var value: String?
How to get a content of the Optional value?
var ret = value! // get
var ret = value ?? “It is nil” // getOrElse
Exceptions Suck
We are really sick and tired of Java Exceptions.

Exceptions remind me of GO TO statement.
try {
int val = String(“xxx”).parseInt();
doSomething…;
doSomething…;
doSomething…;
doSomething…;
doSomething…;
doSomething…;
} catch(Exception e) {
// What has happened ???
// i don’t care…. just throws e;
}

Contenu connexe

Tendances

F#语言对异步程序设计的支持
F#语言对异步程序设计的支持F#语言对异步程序设计的支持
F#语言对异步程序设计的支持jeffz
 
Introduction to meta-programming in scala
Introduction to meta-programming in scalaIntroduction to meta-programming in scala
Introduction to meta-programming in scalaAlessandro Marrella
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Insidejeffz
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library designLeonardo Borges
 
Scala Refactoring for Fun and Profit
Scala Refactoring for Fun and ProfitScala Refactoring for Fun and Profit
Scala Refactoring for Fun and ProfitTomer Gabel
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Michael Barker
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowViliam Elischer
 
Rubyistを誘うScalaの世界 2.0
Rubyistを誘うScalaの世界 2.0Rubyistを誘うScalaの世界 2.0
Rubyistを誘うScalaの世界 2.0Yuto Matsukubo
 
The essence of Reactive Programming
The essence of Reactive ProgrammingThe essence of Reactive Programming
The essence of Reactive ProgrammingEddy Bertoluzzo
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java DevelopersMichael Galpin
 
AutoDesk
AutoDeskAutoDesk
AutoDeskSE3D
 
Scala introduction
Scala introductionScala introduction
Scala introductionvito jeng
 
JavaScript For CSharp Developer
JavaScript For CSharp DeveloperJavaScript For CSharp Developer
JavaScript For CSharp DeveloperSarvesh Kushwaha
 
Java プログラマーのための Swift 入門 #中央線Meetup
Java プログラマーのための Swift 入門 #中央線MeetupJava プログラマーのための Swift 入門 #中央線Meetup
Java プログラマーのための Swift 入門 #中央線MeetupShinya Mochida
 
Introduction to Scala : Clueda
Introduction to Scala : CluedaIntroduction to Scala : Clueda
Introduction to Scala : CluedaAndreas Neumann
 
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)Tomer Gabel
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlinvriddhigupta
 

Tendances (19)

F#语言对异步程序设计的支持
F#语言对异步程序设计的支持F#语言对异步程序设计的支持
F#语言对异步程序设计的支持
 
Introduction to meta-programming in scala
Introduction to meta-programming in scalaIntroduction to meta-programming in scala
Introduction to meta-programming in scala
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
The algebra of library design
The algebra of library designThe algebra of library design
The algebra of library design
 
Scala Refactoring for Fun and Profit
Scala Refactoring for Fun and ProfitScala Refactoring for Fun and Profit
Scala Refactoring for Fun and Profit
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
 
Rubyistを誘うScalaの世界 2.0
Rubyistを誘うScalaの世界 2.0Rubyistを誘うScalaの世界 2.0
Rubyistを誘うScalaの世界 2.0
 
The essence of Reactive Programming
The essence of Reactive ProgrammingThe essence of Reactive Programming
The essence of Reactive Programming
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java Developers
 
AutoDesk
AutoDeskAutoDesk
AutoDesk
 
1.2 scala basics
1.2 scala basics1.2 scala basics
1.2 scala basics
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
JavaScript For CSharp Developer
JavaScript For CSharp DeveloperJavaScript For CSharp Developer
JavaScript For CSharp Developer
 
Java プログラマーのための Swift 入門 #中央線Meetup
Java プログラマーのための Swift 入門 #中央線MeetupJava プログラマーのための Swift 入門 #中央線Meetup
Java プログラマーのための Swift 入門 #中央線Meetup
 
Introduction to Scala : Clueda
Introduction to Scala : CluedaIntroduction to Scala : Clueda
Introduction to Scala : Clueda
 
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlin
 

En vedette

Myths about lung cancer disease
Myths about lung cancer diseaseMyths about lung cancer disease
Myths about lung cancer diseaselee shin
 
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.AnastasiyaF
 
Rpp bab-2 (iman kepada allah)
Rpp bab-2 (iman kepada allah)Rpp bab-2 (iman kepada allah)
Rpp bab-2 (iman kepada allah)hapidlohsani
 
Improving Organizational Risk Management Practice
Improving Organizational Risk Management PracticeImproving Organizational Risk Management Practice
Improving Organizational Risk Management PracticeMansoor Faridi, CISA
 
A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...
 A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com... A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...
A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...nexgentechnology
 
01. Уводзіны
01. Уводзіны01. Уводзіны
01. УводзіныAnastasiyaF
 
BLOG-POST_DATA CENTER INCENTIVE PROGRAMS
BLOG-POST_DATA CENTER INCENTIVE PROGRAMSBLOG-POST_DATA CENTER INCENTIVE PROGRAMS
BLOG-POST_DATA CENTER INCENTIVE PROGRAMSDaniel Bodenski
 
Mohamed Ramzy Cv 2016
Mohamed Ramzy Cv 2016Mohamed Ramzy Cv 2016
Mohamed Ramzy Cv 2016mohamed ramzy
 
Список горячих линий по обезболиванию и паллиативной помощи в России
Список горячих линий по обезболиванию и паллиативной помощи в РоссииСписок горячих линий по обезболиванию и паллиативной помощи в России
Список горячих линий по обезболиванию и паллиативной помощи в РоссииФонд Вера
 

En vedette (9)

Myths about lung cancer disease
Myths about lung cancer diseaseMyths about lung cancer disease
Myths about lung cancer disease
 
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.
00. Уводзіны ў гісторыю Беларусі сяр. ХІІІ - сяр. ХVІ ст.
 
Rpp bab-2 (iman kepada allah)
Rpp bab-2 (iman kepada allah)Rpp bab-2 (iman kepada allah)
Rpp bab-2 (iman kepada allah)
 
Improving Organizational Risk Management Practice
Improving Organizational Risk Management PracticeImproving Organizational Risk Management Practice
Improving Organizational Risk Management Practice
 
A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...
 A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com... A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...
A Profit Maximization Scheme with Guaranteed Quality of Service in Cloud Com...
 
01. Уводзіны
01. Уводзіны01. Уводзіны
01. Уводзіны
 
BLOG-POST_DATA CENTER INCENTIVE PROGRAMS
BLOG-POST_DATA CENTER INCENTIVE PROGRAMSBLOG-POST_DATA CENTER INCENTIVE PROGRAMS
BLOG-POST_DATA CENTER INCENTIVE PROGRAMS
 
Mohamed Ramzy Cv 2016
Mohamed Ramzy Cv 2016Mohamed Ramzy Cv 2016
Mohamed Ramzy Cv 2016
 
Список горячих линий по обезболиванию и паллиативной помощи в России
Список горячих линий по обезболиванию и паллиативной помощи в РоссииСписок горячих линий по обезболиванию и паллиативной помощи в России
Список горячих линий по обезболиванию и паллиативной помощи в России
 

Similaire à SWIFT1 Optional

Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?Tomasz Wrobel
 
FFW Gabrovo PMG - JavaScript 2
FFW Gabrovo PMG - JavaScript 2FFW Gabrovo PMG - JavaScript 2
FFW Gabrovo PMG - JavaScript 2Toni Kolev
 
The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)jeffz
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to ScalaTim Underwood
 
Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Manoj Ellappan
 
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert FornalA Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert FornalQA or the Highway
 
Scala uma poderosa linguagem para a jvm
Scala   uma poderosa linguagem para a jvmScala   uma poderosa linguagem para a jvm
Scala uma poderosa linguagem para a jvmIsaias Barroso
 
Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the pointseanmcq
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right timeDavide Cerbo
 
1.2 scala basics
1.2 scala basics1.2 scala basics
1.2 scala basicswpgreenway
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架jeffz
 

Similaire à SWIFT1 Optional (20)

Swift Basics
Swift BasicsSwift Basics
Swift Basics
 
Coding in Style
Coding in StyleCoding in Style
Coding in Style
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
FFW Gabrovo PMG - JavaScript 2
FFW Gabrovo PMG - JavaScript 2FFW Gabrovo PMG - JavaScript 2
FFW Gabrovo PMG - JavaScript 2
 
The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Workshop Scala
Workshop ScalaWorkshop Scala
Workshop Scala
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to Scala
 
Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2
 
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert FornalA Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert Fornal
 
Scala uma poderosa linguagem para a jvm
Scala   uma poderosa linguagem para a jvmScala   uma poderosa linguagem para a jvm
Scala uma poderosa linguagem para a jvm
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
Kotlin on android
Kotlin on androidKotlin on android
Kotlin on android
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the point
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right time
 
1.2 scala basics
1.2 scala basics1.2 scala basics
1.2 scala basics
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架
 

Plus de Futada Takashi (20)

ES6 ECMA2015
ES6 ECMA2015ES6 ECMA2015
ES6 ECMA2015
 
Swift
SwiftSwift
Swift
 
Aws(sdk)
Aws(sdk)Aws(sdk)
Aws(sdk)
 
Objective c(lang)
Objective c(lang)Objective c(lang)
Objective c(lang)
 
Aws(sns)
Aws(sns)Aws(sns)
Aws(sns)
 
Ionic2
Ionic2Ionic2
Ionic2
 
Ionic3
Ionic3Ionic3
Ionic3
 
Ionic
IonicIonic
Ionic
 
Node js
Node jsNode js
Node js
 
Aws
AwsAws
Aws
 
Scala
ScalaScala
Scala
 
Java8
Java8Java8
Java8
 
Ruby
RubyRuby
Ruby
 
Python
PythonPython
Python
 
Golang
GolangGolang
Golang
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Coffee script
Coffee scriptCoffee script
Coffee script
 
AngularJS
AngularJSAngularJS
AngularJS
 
English
EnglishEnglish
English
 
Swift study: Closure
Swift study: ClosureSwift study: Closure
Swift study: Closure
 

Dernier

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 

Dernier (20)

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

SWIFT1 Optional

  • 2. Java < Scala < Swift Java + Eclipse = COBOL Scala + Idea = cool but tricky Swift + Xcode = easy and fun
  • 3. Let’s study Swift. Swift We r gonna study Swift with Playground.
  • 4. Hello World var str: String = “SWIFT” println(“Hello (str) World”)
  • 5. Type Inference var list: String = “Hello World” var list = “Hello World” var obj: MyClass = MyClass() var obj = MyClass() noun: Inference verb: Infer reference report
  • 6. ? var value: Optional<Int> var value: Int? ? indicates that the value may contain nil. func getValueThisMayReturnNil() -> String? func getValueThisWillNotReturnNil() -> String var ret = getValueThisWillNotReturnNil() if ret != nil { // this does not make sense! ret.doSometing()
  • 7. func getValueThisMayReturnNil() -> String? if let ret = getValueThisMayReturnNil() // Unwrappe if Some { ret.doSometing() // normal } else { // Nil } https://www.youtube.com/watch?v=KSkPE_-gBkc&index=4&list=PLy7oRd3ashWodnpf8rjfYEkTgwbOEsKfU&spfreload=1
  • 8. ! var value: String? How to get a content of the Optional value? var ret = value! // get var ret = value ?? “It is nil” // getOrElse
  • 9. Exceptions Suck We are really sick and tired of Java Exceptions. Exceptions remind me of GO TO statement. try { int val = String(“xxx”).parseInt(); doSomething…; doSomething…; doSomething…; doSomething…; doSomething…; doSomething…; } catch(Exception e) { // What has happened ??? // i don’t care…. just throws e; }