|
@@ -35,6 +35,15 @@ Extension of UIView to be formatted as sections.
|
|
|
//The container.
|
|
//The container.
|
|
|
@IBOutlet weak var entry: UIView!
|
|
@IBOutlet weak var entry: UIView!
|
|
|
|
|
|
|
|
|
|
+ //The buttons
|
|
|
|
|
+ @IBOutlet weak var btnPhone: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnMail: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnWhatsapp: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnFacebook: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnTwitter: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnGoogle: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnYoutube: UIImageView!
|
|
|
|
|
+ @IBOutlet weak var btnInstagram: UIImageView!
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
Default constructor
|
|
Default constructor
|
|
@@ -60,21 +69,42 @@ Extension of UIView to be formatted as sections.
|
|
|
*/
|
|
*/
|
|
|
init(s: String, i: Int) {
|
|
init(s: String, i: Int) {
|
|
|
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
|
|
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
|
|
|
- print("CREATING...")
|
|
|
|
|
loadViewFromNib()
|
|
loadViewFromNib()
|
|
|
- print("NIB LOADED...")
|
|
|
|
|
v = self
|
|
v = self
|
|
|
v.frame = bounds
|
|
v.frame = bounds
|
|
|
v.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
v.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
|
v.translatesAutoresizingMaskIntoConstraints = true
|
|
v.translatesAutoresizingMaskIntoConstraints = true
|
|
|
- print("STUFF DONE")
|
|
|
|
|
container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
|
container.translatesAutoresizingMaskIntoConstraints = true
|
|
container.translatesAutoresizingMaskIntoConstraints = true
|
|
|
|
|
|
|
|
container.frame = v.bounds
|
|
container.frame = v.bounds
|
|
|
- print("CONTAINER STUFF DONE")
|
|
|
|
|
v.addSubview(container)
|
|
v.addSubview(container)
|
|
|
- print("END CONSTRUCTOR")
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Set buttons up
|
|
|
|
|
+ let phoneTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapPhone))
|
|
|
|
|
+ btnPhone.isUserInteractionEnabled = true
|
|
|
|
|
+ btnPhone.addGestureRecognizer(phoneTapRecognizer)
|
|
|
|
|
+ let mailTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapMail))
|
|
|
|
|
+ btnMail.isUserInteractionEnabled = true
|
|
|
|
|
+ btnMail.addGestureRecognizer(mailTapRecognizer)
|
|
|
|
|
+ let whatsappTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapWhatsapp))
|
|
|
|
|
+ btnWhatsapp.isUserInteractionEnabled = true
|
|
|
|
|
+ btnWhatsapp.addGestureRecognizer(whatsappTapRecognizer)
|
|
|
|
|
+ let facebookTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapFacebook))
|
|
|
|
|
+ btnFacebook.isUserInteractionEnabled = true
|
|
|
|
|
+ btnFacebook.addGestureRecognizer(facebookTapRecognizer)
|
|
|
|
|
+ let twitterTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapTwitter))
|
|
|
|
|
+ btnTwitter.isUserInteractionEnabled = true
|
|
|
|
|
+ btnTwitter.addGestureRecognizer(twitterTapRecognizer)
|
|
|
|
|
+ let googleTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapGoogle))
|
|
|
|
|
+ btnGoogle.isUserInteractionEnabled = true
|
|
|
|
|
+ btnGoogle.addGestureRecognizer(googleTapRecognizer)
|
|
|
|
|
+ let youtubeTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapYoutube))
|
|
|
|
|
+ btnYoutube.isUserInteractionEnabled = true
|
|
|
|
|
+ btnYoutube.addGestureRecognizer(youtubeTapRecognizer)
|
|
|
|
|
+ let instagramTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapInstagram))
|
|
|
|
|
+ btnInstagram.isUserInteractionEnabled = true
|
|
|
|
|
+ btnInstagram.addGestureRecognizer(instagramTapRecognizer)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -83,4 +113,39 @@ Extension of UIView to be formatted as sections.
|
|
|
override init(frame: CGRect){
|
|
override init(frame: CGRect){
|
|
|
super.init(frame: frame)
|
|
super.init(frame: frame)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ func didTapPhone() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "tel://+34637140371") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapMail() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "mailto:gasteizkomargolariak@gmail.com") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapWhatsapp() {
|
|
|
|
|
+ //As of today, imposible
|
|
|
|
|
+ //UIApplication.shared.openURL(NSURL(string: "+34637140371") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapFacebook() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "http://facebook.com/gmargolariak") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapTwitter() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "http://twitter.com/gmargolariak") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapGoogle() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "https://plus.google.com/106661466029005469492") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapYoutube() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "https://www.youtube.com/user/GasteizkoMargolariak") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ func didTapInstagram() {
|
|
|
|
|
+ UIApplication.shared.openURL(NSURL(string: "https://instagram.com/gmargolariak/") as! URL)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|