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
710
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
Classmethod AI Talks(CATs) #15 司会進行スライド(2025.02.06) / classmethod-ai-talks-aka-cats_moderator-slides_vol15_2025-02-06
shinyaa31
0
170
Ask! NIKKEI RAG検索技術の深層
hotchpotch
13
2.8k
生成AIの利活用を加速させるための取り組み「prAIrie-dog」/ Shibuya_AI_1
visional_engineering_and_design
1
140
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
730
2.5Dモデルのすべて
yu4u
2
610
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.5k
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
2
1.5k
FastConnect の冗長性
ocise
1
9.6k
プロセス改善による品質向上事例
tomasagi
1
1.6k
MC906491 を見据えた Microsoft Entra Connect アップグレード対応
tamaiyutaro
1
480
事業継続を支える自動テストの考え方
tsuemura
0
300
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
500
Featured
See All Featured
Speed Design
sergeychernyshev
25
780
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Become a Pro
speakerdeck
PRO
26
5.1k
Agile that works and the tools we love
rasmusluckow
328
21k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Into the Great Unknown - MozCon
thekraken
35
1.6k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Six Lessons from altMBA
skipperchong
27
3.6k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
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 Λ࡞Ζ͏ʂʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠