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
60
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
「SaaSの次の時代」に重要性を増すステークホルダーマネジメントの要諦 ~解像度を圧倒的に高めPdMの価値を最大化させる方法~
kakehashi
PRO
2
1k
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
11
4.6k
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
0
210
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
160
Bill One 開発エンジニア 紹介資料
sansan33
PRO
6
18k
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
300
LLM時代の検索アーキテクチャと技術的意思決定
shibuiwilliam
3
1.2k
Claude Code を安全に使おう勉強会 / Claude Code Security Basics
masahirokawahara
11
33k
Microsoft 365 / Microsoft 365 Copilot : 自分の状態を確認する「ラベル」について
taichinakamura
0
240
EarthCopilotに学ぶマルチエージェントオーケストレーション
nakasho
0
300
#jawsugyokohama 100 LT11, "My AWS Journey 2011-2026 - kwntravel"
shinichirokawano
0
350
AI駆動1on1〜AIに自分を育ててもらう〜
yoshiakiyasuda
0
120
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
How GitHub (no longer) Works
holman
316
150k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
100
A Soul's Torment
seathinner
6
2.7k
Scaling GitHub
holman
464
140k
A Tale of Four Properties
chriscoyier
163
24k
Designing for humans not robots
tammielis
254
26k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
260
How to build a perfect <img>
jonoalderson
1
5.4k
We Have a Design System, Now What?
morganepeng
55
8.1k
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