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
How to make Xcode Plugin in Swift
Search
Toshihiro Morimoto
March 05, 2016
Technology
0
700
How to make Xcode Plugin in Swift
yidev#22
Toshihiro Morimoto
March 05, 2016
Tweet
Share
More Decks by Toshihiro Morimoto
See All by Toshihiro Morimoto
Xcode8 で開発はどうかわったのか
dealforest
10
6k
魅せるデバッグ技術
dealforest
4
1.5k
LLDB の世界からみた Swift
dealforest
4
5k
Xcode で快適なデバッグライフを追い求める
dealforest
29
22k
Intrducing debug in WWDC2016
dealforest
3
750
swift build と Xcode での Build の違い
dealforest
3
2k
RIP Xcode Plugin 🙏
dealforest
0
4.7k
Introducing Xcode Editor Extension
dealforest
2
4.5k
Introducing Anglerfish
dealforest
2
3.3k
Other Decks in Technology
See All in Technology
Reactフレームワークプロダクトを モバイルアプリにして、もっと便利に。 ユーザに価値を届けよう。/React Framework with Capacitor
rdlabo
0
130
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
Kotlin Multiplatformのポテンシャル
recruitengineers
PRO
2
150
2025年に挑戦したいこと
molmolken
0
160
メールヘッダーを見てみよう
hinono
0
110
2025年のARグラスの潮流
kotauchisunsun
0
800
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
140
Godot Engineについて調べてみた
unsoluble_sugar
0
410
今年一年で頑張ること / What I will do my best this year
pauli
1
220
KMP with Crashlytics
sansantech
PRO
0
240
30分でわかる「リスクから学ぶKubernetesコンテナセキュリティ」/30min-k8s-container-sec
mochizuki875
3
450
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Site-Speed That Sticks
csswizardry
3
270
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
For a Future-Friendly Web
brad_frost
176
9.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Transcript
How to make Xcode Plugin in Swift 2016/03/05 yidev#22 @dealforest
Toshihiro Morimoto
ࣗݾհ
Tuna Cichlid
Agenda • தؒίʔυ(DerivedData)յΕ͗͢ • Xcode Plugin ͷ࡞Γํ
தؒίʔυյΕ͗͢
Swift Λॻ͍͍ͯͯதؒίʔυ͕ յΕΔ͜ͱଟ͘ͳ͍Ͱ͔͢ʁ
DerivedData Λফ͢ͷ ΊΜͲ͘͘͞ͳ͍ʁ
ʮWindowʯ →ʮProductʯ → ʮdeleteʯ
ͬͯΒΕͳ͍ \(^o^)/
ͦͦσόοάΛ͍ͯͯ͠ DerivedData Λফ͢ͷ͕࠷ޙʹͳΔ
։ൃϑϩʔ 1. cording 2. debug 3. clean 4. remove DerivedData
͜ͷखॱͰ։ൃ͍ͯ͠Δͱ ਫ਼ਆతμϝʔδ͕ੵ͞Ε͍ͯ͘
·ͣڥΛ͑Δ 1. cording 2. clean 3. remove DerivedData 4. debug
σόοάʹऔΓֻ͔Δલʹ ڥΛ៉ྷʹ͢Ε ফΛ͑ΒΕΔʁʂ
ͱ͍͑ຖճ clean ͯ͠ DerivedData Λফ͢ͷ ໘͍͘͞
ͤΊͯ clean ࣌ʹ DerivedData Λফ͍ͨ͠
1. cording 2. clean + remove DerivedData 3. debug
ͱ͍͏Θ͚Ͱ࡞Γ·ͨ͠
https://github.com/dealforest/Cichlid
None
dealforest / Ciclid • Clean ࣮ߦ࣌ʹதؒσʔλΛআ • ͬͯΔ͜ͱ͕γϯϓϧ͔ͩΒ Xcode Plugin
Λ࡞ΔࢀߟʹͳΔ • pure Swift
pure Swift!!!!
Έͳ͞Μͬͯ·͔ͨ͠ʁ Swift Ͱ Xcode Plugin ͕ॻ͚ΔΜͰ͢
Swift Ͱ࡞Δ Xcode Pluign ʹ͍ͭͯ ͓͠͠·͢
Xcode Plugin Λ࡞Δϑϩʔ 1. project ͷ࡞ 2. plist ͷߋ৽ 3.
ϓϥάΠϯΛ࣮ߦ͢ΔτϦΨʔΛܾΊΔ 4. Γ͍ͨ͜ͱΛͲ͏࣮ݱ͢Δ͔ௐΔ
1. project ͷ࡞ • kattrali / Xcode-Plugin-Template • Alcatraz ʹ͋Δ
None
None
2. plist ͷߋ৽ • ࠷৽ͷ Xcode Ͱ࣮ߦ͢ΔͨΊʹඞཁ • DVTPlugInCompatibilityUUIDs ʹ
Xcode ͷ UUID ΛՃ • defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID
None
3. Plugin Λ࣮ߦ͢ΔτϦΨʔΛܾΊΔ • Notification Λड͚औ࣮ͬͯߦ • http://dev.classmethod.jp/smartphone/ xcode5-plugin-2/ •
Menu ͔Β࣮ߦ • Shortcut ͔Β࣮ߦ
4. Γ͍ͨ͜ͱΛͲ͏࣮ݱ͢Δ͔ௐΔ • luisobo / Xcode-RuntimeHeaders • class-dump • GitHub
(`Xcode Plugin` Ͱݕࡧ) • Alcatraz ͷ Plugin
Cichlid ͰͲΜͳͷ͔Ѳ͔ͯ͠Β ͕ࣗͬͯΔ Plugin ͷίʔυΛ ಡΉͷΛΦεεϝ
ݕ౼͕ͭ͘ͱ Swift ͔Β Xcode private API Λ ݺͿඞཁ͕͋Γ·͢
Objective-C ͩͱϓϩδΣΫτʹ header ΛՃ͢Ε ܕ͖ͷ instance ͱͯ͠ѻ͑Δ
Swift ͷ߹ɺ NSClassFromString, performSelector, valueForKey ಈతͳݺͼग़ͩ͠Β͚ʹͳΔ...
ͭ·Γશͯ AnyObject /(^o^)\
https://github.com/dealforest/Cichlid/ blob/master/Cichlid/XcodeHelpers.swift
ղܾํ๏ 1. helper ΫϥεΛ࡞ͬͯͦͷதʹूͯ͠ ӨڹൣғΛ࠷খʹ͑Δ(AnyObject) 2. ͍͍ͨΫϥεͷ header Λ༻ҙͯ͠ BridgingHeader
ʹՃ͢Δ (ܕ༗)
BridgingHeader Λ༻ҙ͢Δͷ͕ ݁ߏΊΜͲ͍͘͞
͠ΔͳΒ࡞ΓऴΘͬͨޙʹ Refactoring ͢Ε͍͍
࡞ͬͨޙʁ
alcatraz/alcatraz-packages ʹ PR Λ ૹͬͯ Alcatraz ʹొ͠·͠ΐ͏
·ͱΊ Xcode Plugin Λ࡞Ε ͕ࣗ໘͍͘͜͞ͱΛม͑ΕΔΑ
·ͱΊ ΈΜͳେ͖ Swift Ͱ Xcode Plugin Λ࡞Ζ͏ʂʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠