Slide 1

Slide 1 text

τϨλͰͷ Swift 3 ରԠ @y_koh
 2016/11/29 potatotips #35

Slide 2

Slide 2 text

ࣗݾ঺հ • τϨλͰiOSΤϯδχΞ΍ͬͯ·͢ • @y_koh

Slide 3

Slide 3 text

τϨλSwift 3 ରԠ͠·ͨ͠

Slide 4

Slide 4 text

ͭΒ͔ͬͨ

Slide 5

Slide 5 text

τϨλΞϓϦͷ֓ཁ • 2013೥12݄ϦϦʔεɻϦϦʔεͯ͠3೥ • 2015೥10݄Swift 2.0ಋೖɻ • Swift͸2ׂͰϑΝΠϧ਺͸180 • ίʔυྔ͸શମͰ9ສ5ઍ͘Β͍

Slide 6

Slide 6 text

εέδϡʔϧײ • Ϗϧυ௨Δ·Ͱ1िؒ • ׬ྃ·Ͱ2.5िؒ

Slide 7

Slide 7 text

ରԠॱং 1. ৘ใऩू 2. ϥΠϒϥϦΞοϓσʔτ 3. Swift 3 Convert 4. Τϥʔ௵͠ 5. ಈ࡞֬ೝ

Slide 8

Slide 8 text

৘ใऩू • [iOS][Swift] Swift 3.0ͷมߋ఺·ͱΊ
 http://dev.classmethod.jp/smartphone/iphone/ implemented_proposals_for_swift3/ • iQONΛSwift 3.0.1ʹΞοϓσʔτͨ͠ͱ͖ʹରԠͨ͠ϙΠ ϯτ
 http://tech.vasily.jp/entry/update_swift_3_0_1 • ࠓɺSwift2 Ͱॻ͍͍ͯΔಉ๔ୡ΁ɻ࠷௿ݶ΍͓͖ͬͯͨ ͍ɺSwift2 ͷ··Ͱ࢝ΊΔ Swift3 ରࡦ
 http://qiita.com/ezura/items/e7703eb04d2d1f2946b9

Slide 9

Slide 9 text

ϥΠϒϥϦΞοϓσʔτ • Swift 3 ʹରԠ͍ͯ͠Δ͔஍ಓʹௐ΂Δ • ରԠͯ͠ͳ͚Ε͹৐Γ׵͑΋ݕ౼ • Obj-CϥΠϒϥϦ΋nullable, nonnullରԠͯͨ͠Γ ͢ΔͷͰ֬ೝͯ͠ΈΔͱྑ͍

Slide 10

Slide 10 text

Swift 3 Convert • ݁ߏ͔͔࣌ؒΔ • ౰વʁ͏·͘ConvertͰ͖ͳ͍ͱ͜Ζ͕͋Δ

Slide 11

Slide 11 text

͏·͘ConvertͰ͖ͳ͔ͬͨͱ ͜Ζ • enumͷlower camel caseԽ • UIFont.systemFontOfSize(CGFloat)
 →UIFont.systemFont(ofSize: CGFloat) • CGRectMake→CGRect(x: , y:)
 CGPointMake→CGPoint(x: , y: , width: , height:) • NSIndexPath(forRow: 0, inSection: 0)
 →IndexPath(row: 0, section: 0)

Slide 12

Slide 12 text

ରԠͷίπ • ஔ׵scriptΛ࡞͓ͬͯ͘ͱྑ͍ • ৽͘͠ݟ͚ͭͨߏจΤϥʔ͸scriptʹஔ׵ίϚϯυ Λ௥Ճ࣮ͯ͠ߦΛ܁Γฦ͢ • ҙ֎ͱػցతʹஔ׵Ͱ͖Δͱ͜Ζ͸ଟ͍ • ͠ΐ͏΋ͳ͍Τϥʔ͸ͳΔ΂ࣗ͘ಈԽͰରԠ

Slide 13

Slide 13 text

େมͳͷ͸ϥΠϒϥϦ

Slide 14

Slide 14 text

Bolts • BFTask(result: hoge)ͰArrayΛฦͤ ͳ͍ • AnyObject͕protocolʹͳΓɺArray͸ͦΕʹద ߹͍ͯ͠ͳ͍ • ࢓ํͳ͍ͷͰࠓ͸NSArrayͰϥοϓͯ͠ฦͯ͠Δ

Slide 15

Slide 15 text

TZStackView • ܧঝͯ͠࢖͍͕ͬͯͨɺclass͕openʹͳ͓ͬͯ ΒͣܧঝͰ͖ͳ͍ • ͳ͔ͥϨΠΞ΢τ่͕ΕΔ

Slide 16

Slide 16 text

SwiftBond • v4→v5ʹͳΔʹ͋ͨͬͯ಺෦࣮૷͕ReactiveKit ʹͳͬͨ • ߏจͷॻ͖׵͑΋ͦͦ͜͜େม • ڍಈ͕ҟͳΔ • ͳ͔ͥແݶϧʔϓɻɻ

Slide 17

Slide 17 text

ͦͷଞࡉ͔͍ॴ • ໌ࣔతΩϟετ͕ඞཁʹ • (date as NSDate).mt_hourOfDay() • ͓Αͦ100Օॴ

Slide 18

Slide 18 text

ಈ࡞֬ೝ • ౰વͳ͕ΒશମΛ֬ೝ͢Δඞཁ͕͋Δ • Ϋϥογϡ͢ΔͳΒ·ͩྑ͍ • ͠Εͬͱදࣔ͞Ε͍ͯͳ͍΋ͷ΋͋ͬͨΓ • ରԠલͷΞϓϦͱݟൺ΂ͳ͕Β֬ೝ͢Δ

Slide 19

Slide 19 text

·ͱΊ • ࢥͬͨҎ্ʹେมͰͨ͠ • Ϗϧυ௨͢·Ͱಈ࡞֬ೝ͕Ұ੾Ͱ͖ͳ͍ • ϥΠϒϥϦʹΑͬͯ͸݁ߏڍಈ͕มΘͬͯ·͢ • ஔ׵scriptΛ༻ҙ͢Δͱྑͦ͞͏

Slide 20

Slide 20 text

དྷ೥ͷSwift 4 Ͱ͸
 ָʹͳΔ͸ͣ