-
Notifications
You must be signed in to change notification settings - Fork 3
/
AppDelegate.swift
47 lines (33 loc) · 1.27 KB
/
AppDelegate.swift
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
//
// AppDelegate.swift
// Mobile Barcode Demo
//
// Created by Michael Chernikov on 20/05/16.
// Copyright © 2016 Atalasoft, a Kofax Company. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
return true
}
func applicationWillResignActive(application: UIApplication) {
}
func applicationDidEnterBackground(application: UIApplication) {
}
func applicationWillEnterForeground(application: UIApplication) {
}
func applicationDidBecomeActive(application: UIApplication) {
Settings.validateLimitation()
if Settings.ExceedLimitation {
let alert = UIAlertController(title: "Error", message: "You have reached your monthly usage limit.", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default) { action -> Void in })
if let wnd = window {
wnd.rootViewController?.presentViewController(alert, animated: true, completion: nil)
}
}
}
func applicationWillTerminate(application: UIApplication) {
}
}