Evil but simple code injection, don't use!
let view = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 50.0, height: 50.0))
view.backgroundColor = UIColor.red
view.koala🐨.layoutSubviews { ✅ // inject code after original implementation
$0.backgroundColor = UIColor.blue
}
let viewController = UIViewController()
viewController.koala🐨.setTitle { ✅
let title = $1.arguments()[0] as NSString
}
let viewController = UIViewController()
viewController.koala🐨.before.viewWillDisappear { ✅
$1.arguments()[0] = true
}
let viewController = UIViewController()
viewController.koala🐨.prefersStatusBarHidden { () -> Bool in ✅
return Bool.random()
}
let viewController = UIViewController()
viewController.title = "Hello"
viewController.koala🐨.title { (_, _, result) -> NSString? in ✅
return result?.appending(" world") as NSString?
}
Oliver Letterer, [email protected]
KoalaInjection is available under the MIT license. See the LICENSE file for more info.