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
From Xcode plugin to Xcode extension
Search
Khoa Pham
November 02, 2018
Technology
0
430
From Xcode plugin to Xcode extension
My talk at Mobile Era conference 2018 in Oslo
Khoa Pham
November 02, 2018
Tweet
Share
More Decks by Khoa Pham
See All by Khoa Pham
Introduction to Swiftlane
onmyway133
0
160
Better AppStore rating
onmyway133
0
590
Pragmatic Machine Learning for mobile apps
onmyway133
0
440
Unit Testing in iOS
onmyway133
0
540
Getting started with Flutter
onmyway133
2
660
Collection Update
onmyway133
4
430
A Taste of MVVM + RxSwift
onmyway133
1
590
LLDB
onmyway133
0
430
Block
onmyway133
0
560
Other Decks in Technology
See All in Technology
後進育成のしくじり〜任せるスキルとリーダーシップの両立〜
matsu0228
1
930
非同期処理実行基盤 Delayed脱出 → Solid Queue完全移行への旅路。
srockstyle
3
1.6k
Green Tea Garbage Collector の今
zchee
PRO
2
370
[2025-09-30] Databricks Genie を利用した分析基盤とデータモデリングの IVRy の現在地
wxyzzz
0
430
KMP の Swift export
kokihirokawa
0
260
Pure Goで体験するWasmの未来
askua
1
170
Geospatialの世界最前線を探る [2025年版]
dayjournal
3
450
自作LLM Native GORM Pluginで実現する AI Agentバックテスト基盤構築
po3rin
2
220
KAGのLT会 #8 - 東京リージョンでGAしたAmazon Q in QuickSightを使って、報告用の資料を作ってみた
0air
0
190
非エンジニアのあなたもできる&もうやってる!コンテキストエンジニアリング
findy_eventslides
3
870
AI×Data×SaaS×Operation
sansantech
PRO
0
110
多野優介
tanoyusuke
1
140
Featured
See All Featured
Producing Creativity
orderedlist
PRO
347
40k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.6k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
890
The Straight Up "How To Draw Better" Workshop
denniskardys
237
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.2k
A Tale of Four Properties
chriscoyier
160
23k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
How GitHub (no longer) Works
holman
315
140k
Docker and Python
trallard
46
3.6k
Site-Speed That Sticks
csswizardry
11
870
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.7k
Transcript
From Xcode plugin to Xcode extension
About Khoa Pham github.com/onmyway133 github.com/hyperoslo medium.com/@onmyway133
It takes 2 iOS developers to start complaining about Xcode
XcodeWay
Xcode plugin
Alcatraz
XVim
SCXcodeMiniMap
FuzzyAutocompletePlugin
ColorSense-for-Xcode
Techniques • Private frameworks • Objective C Runtime • LLDB
• Swizzling
class-dump • IDEKit • DVTKit • Xcode.app/Contents/SharedFrameworks/DVTKit.framework
None
DVTBezelAlertPanel class func swizzleMethods() { guard let originalClass = NSClassFromString("DVTBezelAlertPanel")
as? NSObject.Type else { return } do { try originalClass.jr_swizzleMethod("initWithIcon:message:parentWindow:duration:", withMethod: "xmas_initWithIcon:message:parentWindow:duration:") } catch { Swift.print("Swizzling failed") } }
None
DVTSourceTextView func listenNotification() { NSNotificationCenter.defaultCenter().addObserver( self, selector: #selector(handleSelectionChange(_:)), name: NSTextViewDidChangeSelectionNotification,
object: nil) } func handleSelectionChange(note: NSNotification) { guard let DVTSourceTextView = NSClassFromString("DVTSourceTextView") as? NSObject.Type, object = note.object where object.isKindOfClass(DVTSourceTextView.self), let textView = object as? NSTextView else { return } self.textView = textView }
IDEWorkspaceWindowController self.IDEWorkspaceWindowControllerClass = objc_getClass("IDEWorkspaceWindowController"); NSArray *workspaceWindowControllers = [self.IDEWorkspaceWindowControllerClass valueForKey:@"workspaceWindowControllers"];
XcodeGhost
Xcode Source Editor extension • Modify contents • Modify current
text selection • Seperated process protocol XCSourceEditorCommand { func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) }
App Extension • Share • Photo Editing • Today •
Finder Sync • Custom Keyboard • File Provider • Document Provider
Resign codesign
XcodeColorSense extension ? • No Notification • No UI modification
Color literal ! #colorLiteral
XcodeWay extension ? • No NSTask • No NSWorkspace •
No swizzling
AppleScript !
None
• NSUserAppleScriptTask • NSAppleEventDescriptor • ProcessSerialNumber on myOpenFolder(myPath) tell application
"Finder" activate open myPath as POSIX file end tell end myOpenFolder
App Sandbox
Scripts Directory NSApplicationScriptsDirectory
macOS Mojave • WWDC 2018 - Your Apps and the
Future of macOS Security • NSAppleEventsUsageDescription
• https://github.com/onmyway133/XcodeWay • https://github.com/onmyway133/XcodeColorSense2 • https://github.com/theswiftdev/awesome-xcode-extensions
Thanks May your code continue to compile