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
Swift 2.2 の新機能
Search
Kazuki Ohara
April 02, 2016
Programming
0
510
Swift 2.2 の新機能
Kazuki Ohara
April 02, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
3
1.4k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
710
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
0
230
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
520
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
260
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
240
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
600
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
150
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
590
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
150
VS Code Update for GitHub Copilot
74th
1
550
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
500
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
230
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Producing Creativity
orderedlist
PRO
346
40k
Gamification - CAS2011
davidbonilla
81
5.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Transcript
4XJGUͷ৽ػೳ େݪҰً
ࣗݾհ w ඇܞଳ ήʔϜձࣾͰ ඇήʔϜ J04ΞϓϦΛ࡞ͬͯΔ ΤϯδχΞ w 4XJGUྐྵϲ݄ऑ w
5XJUUFS!PSDIFMZ w 'BDFCPPLLB[VLJPIBSB w 2JJUBPSDIFMZ
None
΄ͱΜͲͷ ΩʔϫʔυΛҾϥϕϧͰ ͑ΔΑ͏ʹ͢Δ
Ҿϥϕϧ indexOf(value, in: collection) ҾͷׂΛ໌֬ʹ͠ ՄಡੑΛ্ͤ͞Δ
Ͱ JOΩʔϫʔυ
let names = [ "C", "Objective-C", "Swift" ] for name
in names { print("Hello \(name)!") }
͑ͳ͍ʂ
4XJGUͰશͯͷΩʔϫʔυ͕ Ҿϥϕϧͱͯ͠ ͑ΔΑ͏ʹͳΓ·ͨ͠ ͨͩ͠MFU WBS JOPVUআ͘
λϓϧൺֱԋࢉࢠ
λϓϧΛ͑Ϋϥεɺ ߏମΛఆٛ͢Δ͜ͱͳ͘ ෳͷཁૉΛ࣋ͭσʔλΛѻ͑Δ let rhythm = (3, 3, 7)
͔ؔΒෳͷΛ ฦ͢߹ʹศར func getRhythm() -> (Int, Int, Int) { return
(3, 3, 7) } let rhythm = getRhythm()
͔͠͠ ൺֱԋࢉࢠ͕ͳ͍
let rhythm = getRhythm() if rhythm == (5, 7, 5)
{ print("haiku") } ͜ͷΤϥʔʹͳΔ
4XJGUͰλϓϧʹ͕ ͑ΔΑ͏ʹͳͬͨ ଞʹ
Ҿϥϕϧ͖ͷ ؔͷ໊લ
extension UIView { func insertSubview(view: UIView, at index: Int) func
insertSubview(view: UIView, aboveSubview siblingSubview: UIView) func insertSubview(view: UIView, belowSubview siblingSubview: UIView) } 4XJGUͰ໊લಉ͡ͰҾ ϥϕϧ͕ҧ͏͕ؔΑ͋͘Δ
͔͠͠ ݺͼग़͢Ҏ֎ͷతͰ ͜ͷؔΛࢦఆ͢Δ߹ɺ ҾϥϕϧΛ༩͑ΒΕͳ͍ͷͰ ᐆດʹͳΔ let someView: UIView = ...
let fn = someView.insertSubview
Ͳͷ JOTFSU4VC7JFX
4XJGUͰҾϥϕϧΛ ࢦఆͰ͖ΔΑ͏ʹͳͬͨ MFUGOTPNF7JFXJOTFSU4VCWJFX @BU MFUGOTPNF7JFXJOTFSU4VCWJFX @BCPWF4VCWJFX
ηϨΫλͷࢦఆํ๏
class NSNotificationCenter { func addObserver(_ observer: AnyObject, selector aSelector: Selector,
name aName: String?, object anObject: AnyObject?) } 4XJGUͰϝιουΛࢦఆ͢Δ ͨΊͷηϨΫλͱ͍͏ͷΛ ͏͜ͱ͕͋Δ
ྫϘϦϡʔϜ͕มԽͨ͠Β TFMG ଟ"QQ%FMFHBUF ͷ WPMVNF$IBOHFEϝιου͕ ݺΕΔΑ͏ʹొ͢Δ NotificationCenter.defaultCenter().addObserver(self, selector: "volumeChanged:", name:
"AVSystemController_SystemVolumeDidChangeNotification", object: nil) ηϨΫλʹจࣈྻΛͬͯ ϝιουΛࢦఆ͍ͯ͠Δ
ίϯύΠϥจࣈྻͷ༰Λ νΣοΫ͠ͳ͍ ଘࡏ͠ͳ͍ϝιουͩͱ ࣮ߦ࣌Τϥʔ͕ى͖Δʂ
͜Μͳͷόάͷݩ Ͱ͢ΑͶ
4XJGUͰ͜͏ॻ͚·͢ ଘࡏ͠ͳ͍ϝιουΛࢦఆ͢Δͱ ίϯύΠϧΤϥʔʹͳΓ ࣮ߦ࣌ΤϥʔΛ͛·͢ NotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.volumeChanged(_:)), name: "AVSystemController_SystemVolumeDidChangeNotification", object:
nil)
͋Γ͕ͱ͏ ͍͟͝·ͨ͠