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
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.3k
Other Decks in Technology
See All in Technology
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
390
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
140
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
200
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
110
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
540
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
850
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.5k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Building an army of robots
kneath
302
44k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Adopting Sorbet at Scale
ufuk
73
9.1k
Optimizing for Happiness
mojombo
376
70k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Gamification - CAS2011
davidbonilla
80
5.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
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 Λ࡞Ζ͏ʂʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠