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
100
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
180
React Native in a native world
neilkimmett
0
210
React Native on tvOS
neilkimmett
0
1.9k
Contributing to Swift
neilkimmett
0
63
Contributing to Swift
neilkimmett
0
49
A Swift introduction
neilkimmett
0
140
Writing Swift
neilkimmett
0
300
Practical WatchKit
neilkimmett
0
290
So you want to make an Apple Watch app?
neilkimmett
0
150
Other Decks in Technology
See All in Technology
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
180
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
Engineer Career Talk
lycorp_recruit_jp
0
150
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
7
800
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
AGIについてChatGPTに聞いてみた
blueb
0
130
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
250
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Building Your Own Lightsaber
phodgson
103
6.1k
Making Projects Easy
brettharned
115
5.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
The Invisible Side of Design
smashingmag
298
50k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
What's in a price? How to price your products and services
michaelherold
243
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Automating Front-end Workflow
addyosmani
1366
200k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
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