-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegSceneBaseViewController.swift
More file actions
56 lines (47 loc) · 1.25 KB
/
RegSceneBaseViewController.swift
File metadata and controls
56 lines (47 loc) · 1.25 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
56
//
// RegSceneBaseViewController.swift
// Absinthe-iOS
//
// Created by Mitchell Kahn on 9/21/16.
// Copyright © 2016 AppDelegates. All rights reserved.
//
import UIKit
class RegSceneBaseViewController: UIViewController {
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
@IBAction func onBack(_ sender: UIButton) {
self.navigationController!.popViewController(animated: true)
}
func fadeIn(_ view: UIView) {
if view.alpha == 0 {
UIView.animate(withDuration: 0.35, animations: {
view.alpha = 1
})
}
}
func fadeOut(_ view: UIView) {
UIView.animate(withDuration: 0.35, animations: {
view.alpha = 0
})
}
func fade(_ view: UIView, onCondition: Bool) {
if onCondition {
fadeIn(view)
} else {
fadeOut(view)
}
}
func isValidEmail(_ string: String?) -> Bool {
if let str = string {
return str.isValidEmail()
}
return false
}
func isValidPassword(_ string: String?) -> Bool {
if let str = string {
return str.isValidPwd()
}
return false
}
}