Created
August 15, 2022 13:15
-
-
Save chbeer/1d20049793667c4cc1fd27f3ef747414 to your computer and use it in GitHub Desktop.
Hack for fixing a crash in Catalyst when using UIDocumentBrowserViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This uses https://github.com/steipete/InterposeKit.git | |
// I added this code to func application(_, didFinishLaunchingWithOptions:) -> Bool | |
if let clazz = NSClassFromString("NSTouchBarView") { | |
do { | |
let _ = try Interpose(clazz) { | |
try $0.hook("layout", | |
methodSignature: (@convention(c) (AnyObject, Selector) -> Void).self, | |
hookSignature: (@convention(block) (AnyObject) -> Void).self) { | |
store in { `self` in } | |
} | |
} | |
} catch { | |
print("Unable to interpose") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixes
[<NSView …> valueForUndefinedKey:]: this class is not key value coding-compliant for the key cell.