-
Notifications
You must be signed in to change notification settings - Fork 0
/
PFStartVC.swift
74 lines (60 loc) · 2.24 KB
/
PFStartVC.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// PFStartVC.swift
// PocketFriend
//
// Created by Manish Parihar on 16/11/16.
//
import UIKit
class PFStartVC: BaseViewController {
//MARK: - View Controller Life Cycle Methods
override func viewDidLoad() {
super.viewDidLoad()
self.screenDesigningOfStartVC()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//MARK: - Screen Designing Methods
func screenDesigningOfStartVC(){
rightHeaderButton.setTitle("Start", for: .normal)
leftHeaderButton.isHidden = true
for tag in 100...102{
let btn:UIButton = self.view.viewWithTag(tag) as! UIButton
btn.layer.cornerRadius = 30
btn.layer.masksToBounds = true
}
}
// MARK: - Navigation
override func rightHeaderButtonClicked(_ sender: UIButton) {
self.navigateToSignUp()
}
//MARK: - Operational Methods
func navigateToSignUp(){
if appDelegate.userInfo==nil{
let signUpVC: PFSignUpVC = self.storyboard?.instantiateViewController(withIdentifier: "PFSignUpVC") as! PFSignUpVC
self.navigationController?.pushViewController(signUpVC, animated: true)
}
else{
let chatViewController = self.storyboard?.instantiateViewController(withIdentifier: "PFChatVC") as! PFChatVC
self.navigationController?.pushViewController(chatViewController, animated: true)
}
}
@IBAction func openURLClicked(_ sender: UIButton)
{
var urlString:String = "About"
if sender.tag == 100{
urlString = "Howtouse"
}
else if sender.tag == 102{
urlString = "Disclaimer"
}
let path = Bundle.main.url(forResource: urlString, withExtension: "html")
let urlRequest = NSURLRequest(url:path!)
// Go To ChatBot
let webVC:PFWebVC = self.storyboard?.instantiateViewController(withIdentifier: "PFWebVC") as! PFWebVC
webVC.urlRequest = urlRequest
self.navigationController?.pushViewController(webVC, animated: true)
}
}