Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DrawingKit playground for iOS 10
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
You can’t perform that action at this time.