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
290
React Native in a native world
neilkimmett
0
270
React Native on tvOS
neilkimmett
0
2.2k
Contributing to Swift
neilkimmett
0
86
Contributing to Swift
neilkimmett
0
70
A Swift introduction
neilkimmett
0
170
Writing Swift
neilkimmett
0
370
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
LLM Internals: 언어 모델의 계보와 알고리즘 진화 (2023~2026)
inureyes
PRO
1
840
カーネルまで探検して理解するふたつの自動計装
sumiyae
0
110
Sets in Go
ramalho
1
1.2k
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
520
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
2
460
AI・HPC開発を支えるGPU環境の新しい選択肢 液冷GPUシステム「AquSys」の取り組み
gpuunite_official
0
190
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
290
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
160
2026-08-15 JAWS-UG 茨城 #16 Secrets ManagerにおけるSecret値の管理(Terraformの場合) / Secrets Manager Secrets
masasuzu
0
470
形式手法特論:Hyperproperty とモデル検査 #kernelvm / Kernel VM Study Tokyo 19th
ytaka23
0
500
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
240
도구에서 동료까지: 10년차 AI 스타트업의 AI 적응기
inureyes
PRO
1
320
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
470
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
The Language of Interfaces
destraynor
162
27k
Evolving SEO for Evolving Search Engines
ryanjones
0
260
Bash Introduction
62gerente
615
220k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
250
The Mindset for Success: Future Career Progression
greggifford
PRO
0
460
Documentation Writing (for coders)
carmenintech
77
5.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.4k
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