-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountBaseViewController.swift
More file actions
53 lines (43 loc) · 1.4 KB
/
AccountBaseViewController.swift
File metadata and controls
53 lines (43 loc) · 1.4 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
//
// AccountBaseViewController.swift
// Absinthe-iOS
//
// Created by Alyssa Torres on 10/18/16.
// Copyright © 2016 AppDelegates. All rights reserved.
//
// This is the ViewController that all Settings (a.k.a. Account) pages
//
import UIKit
class AccountBaseViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.backBarButtonItem = UIBarButtonItem(title:"", style:.plain, target:nil, action:nil)
}
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
func fadeIn(_ view: UIView){
UIView.animate(withDuration: 0.5, animations: {
view.alpha = 1.0
})
}
func fadeOut(_ view: UIView){
UIView.animate(withDuration: 0.5, animations: {
view.alpha = 0.0
})
}
func fade(_ view: UIView, onCondition: Bool) {
if onCondition {
fadeIn(view)
} else {
fadeOut(view)
}
}
func showAlert(_ title: String, message: String) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default) { (action) in
}
alertController.addAction(okAction)
self.present(alertController, animated: true, completion: nil)
}
}