Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift Test - Answers
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Tom Adriaenssen
July 02, 2014
Programming
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift Test - Answers
The answers for a fun test on Swift I made for the iCapps Team Meeting on 2/7/2014.
Tom Adriaenssen
July 02, 2014
More Decks by Tom Adriaenssen
See All by Tom Adriaenssen
Async View Controllers (CocoaHeadsBE)
inferis
1
170
Async View Controllers
inferis
1
950
Practical Autolayout
inferis
0
210
Communicating with GIFs
inferis
0
480
Swift Test
inferis
0
2.7k
Autolayout Primer
inferis
4
260
Objective-C Runtime in Practice
inferis
3
360
Adventures in Multithreaded Core Data
inferis
1
150
Other Decks in Programming
See All in Programming
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
230
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.5k
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
350
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
390
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.4k
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7k
気持ちぃ〜角丸 Squircle
ryu1013
0
360
Railsバージョンを4倍にした話
optim
0
810
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
190
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1k
golang-bob.pdf
iwatsukayura
0
150
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.3k
Docker and Python
trallard
47
4.2k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
From π to Pie charts
rasagy
1
420
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
860
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
600
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
590
Transcript
Swift Test! The answers…
Which of these statements won't compile? 1. if (beers >
0) consumeBeer() 2. if beers > 0 { consumeBeer() } 3. if (beers > 0) { consumeBeer() } 1
How would you declare a variable named awesome of type
Double in Swift? 1. Double awesome 2. var:double awesome 3. var awesome:Double 2
Which of these is not valid Swift? 1. class iCapps
{} 2. enum iCapps {} 3. tuple iCapps {} 4. struct iCapps {} 3
Given: ! what is the result of: 1. stringValue ==
nil 2. stringValue == “Justin Gif” 3. the compiler wont allow it 4 var stringValue:String = “Justin Gif” stringValue = nil
Given Objective-C: ! How would the Swift equivalent look? 1.
rootController?.view?.label?.text = “OHAI” 2. rootController.view.label.text = “OHAI” 3. if rootController != nil { if rootController.view != nil { if rootController.view.label != nil { rootController.view.label.text = “OHAI” } } } 5 rootController.view.label.text = @“OHAI”
How do you declare class methods on a Swift class?
1. class 2. static 3. both 6
What is the mutating keyword for? 1. Indicates a class
can mutate its properties 2. Indicates a method on a struct changes the struct’s values 3. Indicates that a variable will change during its lifetime 7
Which of these is not a built in swift type?
1. Boolean 2. Int 3. String 8
What is the equivalent of Objective-C’s dealloc in Swift? 1.
dealloc 2. dispose 3. deinit 9
What is the expected result? 1. a = [ 33,
44 ] b = [ 33, 55 ] 2. a = [ 33, 55 ] b = [ 33, 55 ] 3. compiler will not allow it 10 let a = [ 33, 44 ] let b = a b[1] = 55
What is the expected result? 1. a = [ 33,
44 ] b = [ 33, 44, 55 ] 2. a = [ 33, 44, 55 ] b = [ 33, 44, 55 ] 3. compiler will not allow it 11 let a = [ 33, 44 ] let b = a b.append(55)
How do you declare an IBOutlet property? 1. @IBOutlet var
button:UIButton 2. var button:UIButton(IBOutlet) 3. var button:UIButton<outlet> 12
let firstString:String? = “abc” let secondString:String! = “abc”
Which of these lines will compile? 1. print firstString? print secondString! 2. print firstString! print secondString 3. print firstString? print secondString 4. print firstString print secondString 13