Last active
February 22, 2019 21:53
-
-
Save regularberry/abbc7a0af431d2bff4b4d910ef941f12 to your computer and use it in GitHub Desktop.
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 UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
class InjectedViewController: UIViewController { | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
print("INJECTED VIEW WILL APPEAR") | |
} | |
} | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
let injected = InjectedViewController() | |
let simple = UIViewController() | |
simple.view.setValue(injected, forKeyPath: "_viewDelegate") | |
window?.addSubview(simple.view) | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment