Created
January 4, 2017 04:34
-
-
Save fmo91/0a007884fd30e54907dc329c107a9d3d to your computer and use it in GitHub Desktop.
Sample AppDelegate that starts the application without using storyboards
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 | |
// MediumSamples | |
// | |
// Created by Fernando Ortiz on 1/3/17. | |
// Copyright © 2017 Fernando Martín Ortiz. All rights reserved. | |
// | |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
self.window = UIWindow(frame: UIScreen.main.bounds) | |
let attribute = "Sample" | |
let initialViewController = SampleViewController(veryImportantAttribute: attribute) | |
window!.rootViewController = initialViewController | |
window!.makeKeyAndVisible() | |
return true | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment