You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.9 KiB

6 years ago
6 years ago
  1. //
  2. // AboutGMEViewController.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 2/13/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class AboutGMEViewController: UIViewController {
  10. let URLFacebookApp: String = "fb://profile/1129818613815224"
  11. let URLFacebookApp2: String = "fb://page/1129818613815224"
  12. let URLFacebookBrowser: String = "https://www.facebook.com/1129818613815224/"
  13. let URLLinkedInApp: String = "linkedin://company/gmeremit/"
  14. let URLLinkedInBrowser: String = "https://www.linkedin.com/company/gmeremit/"
  15. override func viewDidLoad() {
  16. super.viewDidLoad()
  17. }
  18. override func viewWillAppear(_ animated: Bool) {
  19. super.viewWillAppear(animated)
  20. self.setupNormalNavigation()
  21. self.navigationItem.title = "About Gme"
  22. }
  23. override func didReceiveMemoryWarning() {
  24. super.didReceiveMemoryWarning()
  25. // Dispose of any resources that can be recreated.
  26. }
  27. @IBAction func checkForUpdate(_ sender: Any) {
  28. }
  29. @IBAction func openLinkedIn(_ sender: Any) {
  30. UIApplication.tryURL(urls: [self.URLLinkedInApp,
  31. self.URLLinkedInBrowser
  32. ])
  33. }
  34. @IBAction func openFacebook(_ sender: Any) {
  35. UIApplication.tryURL(urls: [self.URLFacebookApp,
  36. self.URLFacebookApp2,
  37. self.URLFacebookBrowser
  38. ])
  39. }
  40. }
  41. extension UIApplication {
  42. class func tryURL(urls: [String]) {
  43. let application = UIApplication.shared
  44. for url in urls {
  45. if application.canOpenURL(URL(string: url)!) {
  46. application.open(URL(string: url)!, options: [:], completionHandler: nil)
  47. return
  48. }
  49. }
  50. }
  51. }