 open class Kitchen: NSObject {
     /// singleton instance
     fileprivate static let sharedKitchen = Kitchen()
+    fileprivate weak var _delegate: TVApplicationControllerDelegate?
     fileprivate static weak var redirectWindow: UIWindow?
     fileprivate static var animatedWindowTransition: Bool = false
     fileprivate static var _navigationControllerDelegateWillShowCount = 0

    public func appController(_ appController: TVApplicationController,
        didFinishLaunching options: [String: Any]?)
    {
    }

    public func appController(_ appController: TVApplicationController,
        didFail error: Error)
    {
        self.kitchenErrorHandler?(error as NSError)
    }

    public func appController(_ appController: TVApplicationController,
        didStop options: [String: Any]?)
    {
    }

    public func appController(_ appController: TVApplicationController,
        evaluateAppJavaScriptIn jsContext: JSContext)
    {
        if let playActionIDHandler = playActionIDHandler {
            let playActionIDHandler: @convention(block) (String) -> Void = { actionID in
                playActionIDHandler(actionID)

     Supposed to be called in application:didFinishedLaunchingWithOptions:
     in UIApplicationDelegate of your @UIApplicationMain .
     - parameter cookbook: a Cookbook configuration object
     - parameter delegate: TVApplicationControllerDelegate
     - returns:  If launch process was successfully or not.
    */
    @discardableResult
    public static func prepare(_ cookbook: Cookbook, delegate: TVApplicationControllerDelegate? = nil) -> Bool {
        sharedKitchen._delegate = delegate
        sharedKitchen.cookbook = cookbook
        sharedKitchen.window = UIWindow(frame: UIScreen.main.bounds)
        sharedKitchen.evaluateAppJavaScriptInContext = cookbook.evaluateAppJavaScriptInContext
