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
Neil Kimmett
August 22, 2016
Technology
0
98
A Swift Introduction To Swift
Given at Codebar August 2016
https://codebar.io/meetings/monthly-aug-2016
Neil Kimmett
August 22, 2016
Tweet
Share
More Decks by Neil Kimmett
See All by Neil Kimmett
Scaling your app's release process
neilkimmett
0
170
React Native in a native world
neilkimmett
0
210
React Native on tvOS
neilkimmett
0
1.8k
Contributing to Swift
neilkimmett
0
60
Contributing to Swift
neilkimmett
0
41
A Swift introduction
neilkimmett
0
140
Writing Swift
neilkimmett
0
290
Practical WatchKit
neilkimmett
0
280
So you want to make an Apple Watch app?
neilkimmett
0
130
Other Decks in Technology
See All in Technology
On Your Data を超えていく!
hirotomotaguchi
2
650
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
Janus
bkuhlmann
1
490
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
4
4.7k
開発パフォーマンスを最大化するための開発体制
ham0215
2
180
生産性向上チームの紹介
cybozuinsideout
PRO
1
860
Next'24 事例セッションの紹介とクラウド資格を活用したキャリア形成について語りMuscle
yasumuusan
1
430
Cracking the KubeCon CfP
inductor
2
220
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.5k
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.3k
JAWS-UG Bedrock Claude Night
yamahiro
3
540
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
280
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
16
3.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
YesSQL, Process and Tooling at Scale
rocio
164
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Into the Great Unknown - MozCon
thekraken
10
990
A Modern Web Designer's Workflow
chriscoyier
689
190k
Testing 201, or: Great Expectations
jmmastey
28
6.3k
Designing the Hi-DPI Web
ddemaree
276
33k
RailsConf 2023
tenderlove
4
540
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Web Components: a chance to create the future
zenorocha
305
41k
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