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
480
0
Share
From Xcode plugin to Xcode extension
My talk at Mobile Era conference 2018 in Oslo
Khoa Pham
November 02, 2018
More Decks by Khoa Pham
See All by Khoa Pham
Introduction to Swiftlane
onmyway133
0
220
Better AppStore rating
onmyway133
0
650
Pragmatic Machine Learning for mobile apps
onmyway133
0
480
Unit Testing in iOS
onmyway133
0
600
Getting started with Flutter
onmyway133
2
710
Collection Update
onmyway133
4
480
A Taste of MVVM + RxSwift
onmyway133
1
650
LLDB
onmyway133
0
480
Block
onmyway133
0
630
Other Decks in Technology
See All in Technology
Datadog 認定試験の概要と対策
uechishingo
0
210
JJUG CCC 2026 Spring AI時代の開発こそ標準化を武器に! ― 方式・プロセス・プラットフォームの標準化
s27watanabe
2
640
long-running-tasks
cipepser
2
450
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
類似画像検索モデルの開発ノウハウ
lycorptech_jp
PRO
4
1.1k
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
2
190
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
550
Ruby::Boxでできること、Refinementsでできること
joker1007
2
110
最低限これだけ押さえれ大丈夫_Claude Enterprise/Team企業展開ガバナンス入門
tkikuchi
1
570
GitHub Copilot CLIでWebアクセシビリティを改善した話
tomokusaba
0
140
組織の中で自分を経営する技術
shoota
0
230
Kaggle未経験社員をメダリストに育てる「AIドラゴン桜」
lycorptech_jp
PRO
0
680
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
55k
Marketing to machines
jonoalderson
1
5.3k
Building the Perfect Custom Keyboard
takai
2
780
GraphQLとの向き合い方2022年版
quramy
50
15k
Evolving SEO for Evolving Search Engines
ryanjones
0
210
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
370
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
First, design no harm
axbom
PRO
2
1.2k
Accessibility Awareness
sabderemane
1
130
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