Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
How to make Xcode Plugin in Swift 2016/03/05 yidev#22 @dealforest Toshihiro Morimoto
Slide 2
Slide 2 text
ࣗݾհ
Slide 3
Slide 3 text
Tuna Cichlid
Slide 4
Slide 4 text
Agenda • தؒίʔυ(DerivedData)յΕ͗͢ • Xcode Plugin ͷ࡞Γํ
Slide 5
Slide 5 text
தؒίʔυյΕ͗͢
Slide 6
Slide 6 text
Swift Λॻ͍͍ͯͯதؒίʔυ͕ յΕΔ͜ͱଟ͘ͳ͍Ͱ͔͢ʁ
Slide 7
Slide 7 text
DerivedData Λফ͢ͷ ΊΜͲ͘͘͞ͳ͍ʁ
Slide 8
Slide 8 text
ʮWindowʯ →ʮProductʯ → ʮdeleteʯ
Slide 9
Slide 9 text
ͬͯΒΕͳ͍ \(^o^)/
Slide 10
Slide 10 text
ͦͦσόοάΛ͍ͯͯ͠ DerivedData Λফ͢ͷ͕࠷ޙʹͳΔ
Slide 11
Slide 11 text
։ൃϑϩʔ 1. cording 2. debug 3. clean 4. remove DerivedData
Slide 12
Slide 12 text
͜ͷखॱͰ։ൃ͍ͯ͠Δͱ ਫ਼ਆతμϝʔδ͕ੵ͞Ε͍ͯ͘
Slide 13
Slide 13 text
·ͣڥΛ͑Δ 1. cording 2. clean 3. remove DerivedData 4. debug
Slide 14
Slide 14 text
σόοάʹऔΓֻ͔Δલʹ ڥΛ៉ྷʹ͢Ε ফΛ͑ΒΕΔʁʂ
Slide 15
Slide 15 text
ͱ͍͑ຖճ clean ͯ͠ DerivedData Λফ͢ͷ ໘͍͘͞
Slide 16
Slide 16 text
ͤΊͯ clean ࣌ʹ DerivedData Λফ͍ͨ͠
Slide 17
Slide 17 text
1. cording 2. clean + remove DerivedData 3. debug
Slide 18
Slide 18 text
ͱ͍͏Θ͚Ͱ࡞Γ·ͨ͠
Slide 19
Slide 19 text
https://github.com/dealforest/Cichlid
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
dealforest / Ciclid • Clean ࣮ߦ࣌ʹதؒσʔλΛআ • ͬͯΔ͜ͱ͕γϯϓϧ͔ͩΒ Xcode Plugin Λ࡞ΔࢀߟʹͳΔ • pure Swift
Slide 22
Slide 22 text
pure Swift!!!!
Slide 23
Slide 23 text
Έͳ͞Μͬͯ·͔ͨ͠ʁ Swift Ͱ Xcode Plugin ͕ॻ͚ΔΜͰ͢
Slide 24
Slide 24 text
Swift Ͱ࡞Δ Xcode Pluign ʹ͍ͭͯ ͓͠͠·͢
Slide 25
Slide 25 text
Xcode Plugin Λ࡞Δϑϩʔ 1. project ͷ࡞ 2. plist ͷߋ৽ 3. ϓϥάΠϯΛ࣮ߦ͢ΔτϦΨʔΛܾΊΔ 4. Γ͍ͨ͜ͱΛͲ͏࣮ݱ͢Δ͔ௐΔ
Slide 26
Slide 26 text
1. project ͷ࡞ • kattrali / Xcode-Plugin-Template • Alcatraz ʹ͋Δ
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
No content
Slide 29
Slide 29 text
2. plist ͷߋ৽ • ࠷৽ͷ Xcode Ͱ࣮ߦ͢ΔͨΊʹඞཁ • DVTPlugInCompatibilityUUIDs ʹ Xcode ͷ UUID ΛՃ • defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
3. Plugin Λ࣮ߦ͢ΔτϦΨʔΛܾΊΔ • Notification Λड͚औ࣮ͬͯߦ • http://dev.classmethod.jp/smartphone/ xcode5-plugin-2/ • Menu ͔Β࣮ߦ • Shortcut ͔Β࣮ߦ
Slide 32
Slide 32 text
4. Γ͍ͨ͜ͱΛͲ͏࣮ݱ͢Δ͔ௐΔ • luisobo / Xcode-RuntimeHeaders • class-dump • GitHub (`Xcode Plugin` Ͱݕࡧ) • Alcatraz ͷ Plugin
Slide 33
Slide 33 text
Cichlid ͰͲΜͳͷ͔Ѳ͔ͯ͠Β ͕ࣗͬͯΔ Plugin ͷίʔυΛ ಡΉͷΛΦεεϝ
Slide 34
Slide 34 text
ݕ౼͕ͭ͘ͱ Swift ͔Β Xcode private API Λ ݺͿඞཁ͕͋Γ·͢
Slide 35
Slide 35 text
Objective-C ͩͱϓϩδΣΫτʹ header ΛՃ͢Ε ܕ͖ͷ instance ͱͯ͠ѻ͑Δ
Slide 36
Slide 36 text
Swift ͷ߹ɺ NSClassFromString, performSelector, valueForKey ಈతͳݺͼग़ͩ͠Β͚ʹͳΔ...
Slide 37
Slide 37 text
ͭ·Γશͯ AnyObject /(^o^)\
Slide 38
Slide 38 text
https://github.com/dealforest/Cichlid/ blob/master/Cichlid/XcodeHelpers.swift
Slide 39
Slide 39 text
ղܾํ๏ 1. helper ΫϥεΛ࡞ͬͯͦͷதʹूͯ͠ ӨڹൣғΛ࠷খʹ͑Δ(AnyObject) 2. ͍͍ͨΫϥεͷ header Λ༻ҙͯ͠ BridgingHeader ʹՃ͢Δ (ܕ༗)
Slide 40
Slide 40 text
BridgingHeader Λ༻ҙ͢Δͷ͕ ݁ߏΊΜͲ͍͘͞
Slide 41
Slide 41 text
͠ΔͳΒ࡞ΓऴΘͬͨޙʹ Refactoring ͢Ε͍͍
Slide 42
Slide 42 text
࡞ͬͨޙʁ
Slide 43
Slide 43 text
alcatraz/alcatraz-packages ʹ PR Λ ૹͬͯ Alcatraz ʹొ͠·͠ΐ͏
Slide 44
Slide 44 text
·ͱΊ Xcode Plugin Λ࡞Ε ͕ࣗ໘͍͘͜͞ͱΛม͑ΕΔΑ
Slide 45
Slide 45 text
·ͱΊ ΈΜͳେ͖ Swift Ͱ Xcode Plugin Λ࡞Ζ͏ʂʂ
Slide 46
Slide 46 text
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠