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
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
280
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
340
So you want to make an Apple Watch app?
neilkimmett
0
180
Other Decks in Technology
See All in Technology
入門!AWS Blocks
ysuzuki
1
120
失敗を経て、Harness Engineering で 大切にしたいことを考える / Learning from Failure: What Matters in Harness Engineering
bitkey
PRO
1
370
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
180
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
340
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
190
人材育成分科会.pdf
_awache
4
250
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
210
AIのReact習熟度を測る
uhyo
2
570
RAG を使わないという選択肢
tatsutaka
1
240
FDE という解 ― 暗黙知と明示知をつなぐ、伴走型エンジニアリング ―
otanet
0
160
失敗を資産に変えるClaude Code
shinyasaita
0
660
LLMにもCAP定理があるという話
harukasakihara
0
370
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
210k
Exploring anti-patterns in Rails
aemeredith
3
410
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
220
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
4 Signs Your Business is Dying
shpigford
187
22k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.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