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
690
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
5.9k
魅せるデバッグ技術
dealforest
4
1.5k
LLDB の世界からみた Swift
dealforest
4
4.9k
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.2k
Other Decks in Technology
See All in Technology
Application Development WG Intro at AppDeveloperCon
salaboy
0
200
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
260
AI前提のサービス運用ってなんだろう?
ryuichi1208
8
1.4k
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
100
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
230
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
660
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
10
1.2k
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Unsuck your backbone
ammeep
668
57k
Building an army of robots
kneath
302
43k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Faster Mobile Websites
deanohume
305
30k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Code Reviewing Like a Champion
maltzj
520
39k
A Tale of Four Properties
chriscoyier
156
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Agile that works and the tools we love
rasmusluckow
327
21k
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 Λ࡞Ζ͏ʂʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠