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
440
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
600
Pragmatic Machine Learning for mobile apps
onmyway133
0
450
Unit Testing in iOS
onmyway133
0
540
Getting started with Flutter
onmyway133
2
660
Collection Update
onmyway133
4
440
A Taste of MVVM + RxSwift
onmyway133
1
600
LLDB
onmyway133
0
430
Block
onmyway133
0
570
Other Decks in Technology
See All in Technology
OSSで50の競合と戦うためにやったこと
yamadashy
3
940
AI-Readyを目指した非構造化データのメダリオンアーキテクチャ
r_miura
1
280
ViteとTypeScriptのProject Referencesで 大規模モノレポのUIカタログのリリースサイクルを高速化する
shuta13
2
120
コンパウンド組織のCRE #cre_meetup
layerx
PRO
0
230
AI時代、“平均値”ではいられない
uhyo
8
2.2k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
940
From Natural Language to K8s Operations: The MCP Architecture and Practice of kubectl-ai
appleboy
0
110
AI AgentをLangflowでサクッと作って、1日働かせてみた!
yano13
1
130
Biz職でもDifyでできる! 「触らないAIワークフロー」を実現する方法
igarashikana
3
1.7k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3k
今この時代に技術とどう向き合うべきか
gree_tech
PRO
2
2.1k
MCP ✖️ Apps SDKを触ってみた
hisuzuya
0
300
Featured
See All Featured
Done Done
chrislema
185
16k
Docker and Python
trallard
46
3.6k
For a Future-Friendly Web
brad_frost
180
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
A designer walks into a library…
pauljervisheath
209
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Visualization
eitanlees
149
16k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Fireside Chat
paigeccino
40
3.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
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