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
370
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
130
Better AppStore rating
onmyway133
0
500
Pragmatic Machine Learning for mobile apps
onmyway133
0
380
Unit Testing in iOS
onmyway133
0
460
Getting started with Flutter
onmyway133
2
580
Collection Update
onmyway133
4
370
A Taste of MVVM + RxSwift
onmyway133
1
530
LLDB
onmyway133
0
360
Block
onmyway133
0
450
Other Decks in Technology
See All in Technology
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
AGIについてChatGPTに聞いてみた
blueb
0
130
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
Terraform Stacks入門 #HashiTalks
msato
0
350
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
B2B SaaS × AI機能開発 〜テナント分離のパターン解説〜 / B2B SaaS x AI function development - Explanation of tenant separation pattern
oztick139
2
220
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
490
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Designing Experiences People Love
moore
138
23k
We Have a Design System, Now What?
morganepeng
50
7.2k
Why Our Code Smells
bkeepers
PRO
334
57k
Raft: Consensus for Rubyists
vanstee
136
6.6k
GitHub's CSS Performance
jonrohan
1030
460k
Code Reviewing Like a Champion
maltzj
520
39k
Building Your Own Lightsaber
phodgson
103
6.1k
Faster Mobile Websites
deanohume
305
30k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
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