-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaboutusViewController.swift
125 lines (78 loc) · 3.44 KB
/
aboutusViewController.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// aboutusViewController.swift
//
//
// Created by Mengyi LUO on 2016-03-10.
//
//
import UIKit
import SafariServices
class aboutusViewController: UIViewController,SFSafariViewControllerDelegate
{
override func viewDidLoad() {
super.viewDidLoad()
print("setting view loaded")
self.automaticallyAdjustsScrollViewInsets = false;
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//icons from: https://dribbble.com/shots/2421400-Social-icons
//let safari = UIApplication.sharedApplication()
func openSafari(userUrl : String){
let svc = SFSafariViewController(URL: NSURL(string: userUrl)!)
svc.delegate = self
self.presentViewController(svc, animated: true, completion: nil)
}
@IBAction func nancylink(sender: UIButton) {
if( sender.currentImage! == UIImage(named:"linkdin_f.png")){
openSafari("https://www.linkedin.com/in/nancy-zhao-ying-li-9b353496")
}
else if (sender.currentImage! == UIImage(named:"github_f.png")) {
openSafari("https://github.com/NancyZhaoLi")
}
}
@IBAction func xinlink(sender: UIButton) {
if( sender.currentImage! == UIImage(named:"linkdin_f.png")){
print(sender)
openSafari("https://www.linkedin.com/in/xin-lin-7a5872b5")
}
else if (sender.currentImage! == UIImage(named:"github_f.png")) {
openSafari("https://github.com/x58lin")
}
//aboutusViewController.dismissViewControllerAnimated(true, completion: nil)
//self.aboutusViewController.dismissViewControllerAnimated(true, completion: nil)
//self.navigationController!.dismissViewControllerAnimated(true, completion: nil)
}
@IBAction func emilylink(sender: UIButton) {
if( sender.currentImage! == UIImage(named:"linkdin_f.png")){
print(sender)
openSafari("https://www.linkedin.com/in/yuning-xue-a5920a62")
}
else if (sender.currentImage! == UIImage(named:"github_f.png")) {
openSafari("https://github.com/xyuning")
}
}
@IBAction func monicalink(sender: UIButton) {
if( sender.currentImage! == UIImage(named:"twitter_f.png")){
openSafari("https://twitter.com/lalaphoon")
}
else if (sender.currentImage! == UIImage(named:"github_f.png")) {
openSafari("https://github.com/lalaphoon")
}
}
func safariViewControllerDidFinish(controller: SFSafariViewController)
{
controller.dismissViewControllerAnimated(true, completion: nil)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}