Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
From Xcode plugin to Xcode extension
Search
Khoa Pham
November 02, 2018
Technology
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
From Xcode plugin to Xcode extension
My talk at Mobile Era conference 2018 in Oslo
Khoa Pham
November 02, 2018
Transcript
32 slides
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
More Decks by Khoa Pham
See All by Khoa Pham
Introduction to Swiftlane
onmyway133
0
240
Better AppStore rating
onmyway133
0
680
Pragmatic Machine Learning for mobile apps
onmyway133
0
510
Unit Testing in iOS
onmyway133
0
630
Getting started with Flutter
onmyway133
2
750
Collection Update
onmyway133
4
510
A Taste of MVVM + RxSwift
onmyway133
1
680
LLDB
onmyway133
0
510
Block
onmyway133
0
660
Other Decks in Technology
See All in Technology
81天的 AI Agent 軟體開發團隊治理實務分享
regionbbs
0
160
会社説明資料_最新版
demaecan
0
32k
Go初心者のクラウドエンジニアが、デプロイを通して旨味を知っていく話
ryudai
1
200
Gifu WordPress Meetup #200 に向けて、私たちには何ができるだろうか?/ 2026-11-07 Gifu WordPress Meetup
torounit
0
280
SSFの現在地 ― CAEP/RISCからAI Identityへ
oidfj
0
430
evcc & Home Assistant
naltatis
0
680
顧客合意を取りながら進めるAWSコスト削減の実践
optim
0
170
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
170
GCASアップデート(202607-202610)
techniczna
1
330
思考過程から秘密が漏れる:Amazon Bedrock上のKimi K3を5つの方法で攻めたら、25回中22回漏洩した話
yama3133
1
150
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
190
cdkd (CDK Direct)
gotok365
4
310
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
The untapped power of vector embeddings
frankvandijk
2
2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
980
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
350
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Believing is Seeing
oripsolob
1
280
Bash Introduction
62gerente
615
220k