This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppDelegate.swift
More file actions
55 lines (40 loc) · 1.51 KB
/
AppDelegate.swift
File metadata and controls
55 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// AppDelegate.swift
// GithubIssues
//
// Created by Leonard on 2017. 9. 9..
// Copyright © 2017년 intmain. All rights reserved.
//
import UIKit
import OAuthSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
if !GlobalState.instance.isLoggedIn {
let loginViewController = LoginViewController.viewController
DispatchQueue.main.asyncAfter(deadline: .now() + 0.0, execute: { [weak self] in
self?.window?.rootViewController?.present(loginViewController, animated: false, completion: nil)
})
}
return true
}
func applicationWillResignActive(_ application: UIApplication) {
}
func applicationDidEnterBackground(_ application: UIApplication) {
}
func applicationWillEnterForeground(_ application: UIApplication) {
}
func applicationDidBecomeActive(_ application: UIApplication) {
}
func applicationWillTerminate(_ application: UIApplication) {
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
print("url: \(url.absoluteString)")
if (url.host == "oauth-callback") {
OAuthSwift.handle(url: url)
}
return true
}
}