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
400
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
140
Better AppStore rating
onmyway133
0
540
Pragmatic Machine Learning for mobile apps
onmyway133
0
420
Unit Testing in iOS
onmyway133
0
510
Getting started with Flutter
onmyway133
2
620
Collection Update
onmyway133
4
410
A Taste of MVVM + RxSwift
onmyway133
1
570
LLDB
onmyway133
0
400
Block
onmyway133
0
510
Other Decks in Technology
See All in Technology
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
coconala_engineer
1
250
いつも初心者向けの記事に助けられているので得意分野では初心者向けの記事を書きます
toru_kubota
2
270
【2025年度新卒技術研修】100分で学ぶ サイバーエージェントのデータベース 活用事例とMySQLパフォーマンス調査
cyberagentdevelopers
PRO
4
6.5k
Beyond {shiny}: The Future of Mobile Apps with R
colinfay
1
370
【日本Zabbixユーザー会】LLDを理解するときの勘所 〜LLDのある世界を楽しもう!〜
yoshitake945
0
120
こんなデータマートは嫌だ。どんな? / waiwai-data-meetup-202504
shuntak
6
1.7k
Devinで模索する AIファースト開発〜ゼロベースから始めるDevOpsの進化〜
potix2
PRO
6
2.7k
Spice up your notifications/try!Swift25
noppefoxwolf
2
340
Spring Bootで実装とインフラをこれでもかと分離するための試み
shintanimoto
4
370
Стильный код: натуральный поиск редких атрибутов по картинке. Юлия Антохина, Data Scientist, Lamoda Tech
lamodatech
0
300
はてなの開発20年史と DevOpsの歩み / DevOpsDays Tokyo 2025 Keynote
daiksy
5
1.4k
7,000名規模の 人材サービス企業における プロダクト戦略・戦術と課題 / Product strategy, tactics and challenges for a 7,000-employee staffing company
techtekt
0
260
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
520
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
Building Applications with DynamoDB
mza
94
6.3k
Bash Introduction
62gerente
611
210k
Product Roadmaps are Hard
iamctodd
PRO
52
11k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Raft: Consensus for Rubyists
vanstee
137
6.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Site-Speed That Sticks
csswizardry
5
480
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