Created
May 6, 2019 12:31
-
-
Save giln/52e5b13d818a1c38f510dc497e8b8133 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
var window: UIWindow? | |
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
window = UIWindow(frame: UIScreen.main.bounds) | |
window?.backgroundColor = UIColor.white | |
window?.makeKeyAndVisible() | |
let listController = ListViewController() | |
let movieStore = MovieStore.shared | |
movieStore.fetchMovies(from: .topRated, params: nil, successHandler: { moviesResponse in | |
print(moviesResponse) | |
listController.list = moviesResponse.results | |
}) { error in | |
print(error) | |
} | |
window?.rootViewController = listController | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment