Created
October 3, 2015 20:29
-
-
Save josescasanova/89296594f1888df3cb48 to your computer and use it in GitHub Desktop.
AppDelegate.swift
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
// | |
// AppDelegate.swift | |
// catVideos | |
// | |
// Created by Jose Casanova on 9/27/15. | |
// Copyright © 2015 Jose Casanova. All rights reserved. | |
// | |
import UIKit | |
import TVMLKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate, TVApplicationControllerDelegate { | |
var window: UIWindow? | |
var appController: TVApplicationController? | |
static let TVBaseURL = "http://localhost:9001/" | |
static let TVBootURL = "\(AppDelegate.TVBaseURL)js/application.js" | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
window = UIWindow(frame: UIScreen.mainScreen().bounds) | |
let appControllerContext = TVApplicationControllerContext() | |
guard let javaScriptURL = NSURL(string: AppDelegate.TVBootURL) else { | |
fatalError("unable to create NSURL") | |
} | |
appControllerContext.javaScriptApplicationURL = javaScriptURL | |
appControllerContext.launchOptions["BASEURL"] = AppDelegate.TVBaseURL | |
appController = TVApplicationController(context: appControllerContext, window: window, delegate: self) | |
return true | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment