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
110
0
Share
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
260
React Native in a native world
neilkimmett
0
260
React Native on tvOS
neilkimmett
0
2.1k
Contributing to Swift
neilkimmett
0
78
Contributing to Swift
neilkimmett
0
59
A Swift introduction
neilkimmett
0
160
Writing Swift
neilkimmett
0
350
Practical WatchKit
neilkimmett
0
330
So you want to make an Apple Watch app?
neilkimmett
0
180
Other Decks in Technology
See All in Technology
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
130
OpenClawでPM業務を自動化
knishioka
2
350
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.3k
Databricks Appsで実現する社内向けAIアプリ開発の効率化
r_miura
0
160
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
11
6.9k
私がよく使うMCPサーバー3選と社内で安全に活用する方法
kintotechdev
0
150
Why we keep our community?
kawaguti
PRO
0
350
AgentCoreとLINEを使った飲食店おすすめアプリを作ってみた
yakumo
2
270
CloudFrontのHost Header転送設定でパケットの中身はどう変わるのか?
nagisa53
1
230
ThetaOS - A Mythical Machine comes Alive
aslander
0
230
【Oracle Cloud ウェビナー】データ主権はクラウドで守れるのか?NTTデータ様のOracle Alloyで実現するソブリン対応クラウドの最適解
oracle4engineer
PRO
3
130
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Why Our Code Smells
bkeepers
PRO
340
58k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
300
The agentic SEO stack - context over prompts
schlessera
0
720
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
Music & Morning Musume
bryan
47
7.1k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
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