Skip to content

Instantly share code, notes, and snippets.

@fmo91
Created January 4, 2017 04:34
Show Gist options
  • Save fmo91/0a007884fd30e54907dc329c107a9d3d to your computer and use it in GitHub Desktop.
Save fmo91/0a007884fd30e54907dc329c107a9d3d to your computer and use it in GitHub Desktop.
Sample AppDelegate that starts the application without using storyboards
//
// 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