DrawingKit playground for iOS 10
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
| import PlaygroundSupport | |
| import Foundation | |
| import UIKit | |
| Bundle(path: "/System/Library/PrivateFrameworks/DrawingKit.framework")?.load() | |
| let DKInkView = NSClassFromString("DKInkView") as! UIView.Type | |
| extension UIView { | |
| func newGPUAvailable() -> Bool { | |
| return true | |
| } | |
| } | |
| func swizzleExtensionCheck() | |
| { | |
| let origMethod = class_getClassMethod(DKInkView, NSSelectorFromString("gpuAvailable")) | |
| let newMethod = class_getInstanceMethod(DKInkView,NSSelectorFromString("newGPUAvailable")) | |
| method_exchangeImplementations(origMethod, newMethod) | |
| } | |
| swizzleExtensionCheck() | |
| let view = DKInkView.init() | |
| PlaygroundPage.current.liveView = view | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment