Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A Swift Introduction To Swift
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Neil Kimmett
August 22, 2016
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A Swift Introduction To Swift
Given at Codebar August 2016
https://codebar.io/meetings/monthly-aug-2016
Neil Kimmett
August 22, 2016
More Decks by Neil Kimmett
See All by Neil Kimmett
Scaling your app's release process
neilkimmett
0
290
React Native in a native world
neilkimmett
0
270
React Native on tvOS
neilkimmett
0
2.1k
Contributing to Swift
neilkimmett
0
84
Contributing to Swift
neilkimmett
0
67
A Swift introduction
neilkimmett
0
170
Writing Swift
neilkimmett
0
360
Practical WatchKit
neilkimmett
0
350
So you want to make an Apple Watch app?
neilkimmett
0
180
Other Decks in Technology
See All in Technology
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
2
830
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
490
世界、断片、モデル。そして理解
ardbeg1958
1
130
しくみを学んで使いこなそう GitHub Copilot app
torumakabe
2
290
仕様駆動開発、導入半年。「本当に速くなってるの?」にデータで答える / AICon2026_hirakawa
rakus_dev
0
150
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
230
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
180
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
230
ソニー銀行におけるビジネスアジリティ向上のためのクラウドシフト戦略
srenext
0
860
GoでCコンパイラを作った話
repunit
0
130
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
0
170
非定型なドキュメントを効率よくリファクタする 〜えぇ!?仕様書27本の移行が1日で終わったって!?〜
subroh0508
2
570
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Test your architecture with Archunit
thirion
1
2.3k
A Tale of Four Properties
chriscoyier
163
24k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
The Spectacular Lies of Maps
axbom
PRO
1
860
Designing Experiences People Love
moore
143
24k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
980
RailsConf 2023
tenderlove
30
1.5k
Transcript
A Swift Introduction To Swift by @neilkimmett
Swift is a type safe language
Types Javascript "1" + 2 = "12" Ruby x =
5 x = "a string" x = Dog.new
Types Swift "1" + 2
Types Swift var x = 5 x = "a string"
Types let number: Int = 2 let name: String =
"Sup Codebar" let primes: [Int] = [2, 3, 5, 7, 11] let view: UIView = UIView() view.backgroundColor = UIColor.whiteColor()
✨ Type inference ✨ let number = 2 let name
= "Sup Codebar" let primes = [2, 3, 5, 7, 11] let view = UIView() view.backgroundColor = .whiteColor()
Constants & variables let words = "Hello, there" words =
"Bye for now"
Constants & variables let words = "Hello, there" words =
"Bye for now"
Constants & variables let words = "Hello, there" words =
"Bye for now"
Constants & variables var words = "Hello, there" words =
"Bye for now"
Functions func multiply(array: [Int], by: Int) -> [Int]
Functions func multiply(array: [Int], by: Int) -> [Int] { var
result = [Int]() for x in array { result.append(x * by) } return result }
Functions func multiply(array: [Int], by: Int) -> [Int] { return
array.map({ (x) -> Int in return x * by }) }
Functions func multiply(array: [Int], by: Int) -> [Int] { return
array.map { $0 * by } }
Functions func multiply(array: [Int], by: Int) -> [Int] { return
array.map { $0 * by } } multiply(array: numbers, by: 2)
Classes class Counter { private var count = 0 func
increment() { count += 1 } } let counter = Counter() counter.increment()
Optionals?!
Optionals class Codebar { var location: String = "Pivotal Labs,
EC1V 9NR" } let codebar = Codebar() // insert lots of awesome talks here codebar.location = "The pub" // insert lots of inspiring conversations here codebar.location = nil !
?
Optionals class Codebar { var location: String? = "Pivotal Labs,
EC1V 9NR" } let codebar = Codebar() // stuff codebar.location = nil !
Other super awesome stuff • structs • enums • protocols
• generics • frameworks
Further reading • "The Swift Programming Language" by Apple •
raywenderlich.com • swift.org • WWDC videos • IBM Swift Sandbox • Swift Playgrounds for iPad on iOS 10
Thanks ! @neilkimmett "
[email protected]
# kimmett.me