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.

66 lines
2.0 KiB

6 years ago
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. @IBOutlet weak var versionLabel: UILabel!
  11. let URLFacebookApp: String = "fb://profile/1129818613815224"
  12. let URLFacebookApp2: String = "fb://page/1129818613815224"
  13. let URLFacebookBrowser: String = "https://www.facebook.com/1129818613815224/"
  14. let URLLinkedInApp: String = "linkedin://company/gmeremit/"
  15. let URLLinkedInBrowser: String = "https://www.linkedin.com/company/gmeremit/"
  16. override func viewDidLoad() {
  17. super.viewDidLoad()
  18. self.versionLabel.text = Utility.getAppVersion()
  19. }
  20. override func viewWillAppear(_ animated: Bool) {
  21. super.viewWillAppear(animated)
  22. self.setupNormalNavigation()
  23. self.navigationItem.title = "About Gme"
  24. }
  25. override func didReceiveMemoryWarning() {
  26. super.didReceiveMemoryWarning()
  27. // Dispose of any resources that can be recreated.
  28. }
  29. @IBAction func checkForUpdate(_ sender: Any) {
  30. }
  31. @IBAction func openLinkedIn(_ sender: Any) {
  32. UIApplication.tryURL(urls: [self.URLLinkedInApp,
  33. self.URLLinkedInBrowser
  34. ])
  35. }
  36. @IBAction func openFacebook(_ sender: Any) {
  37. UIApplication.tryURL(urls: [self.URLFacebookApp,
  38. self.URLFacebookApp2,
  39. self.URLFacebookBrowser
  40. ])
  41. }
  42. }
  43. extension UIApplication {
  44. class func tryURL(urls: [String]) {
  45. let application = UIApplication.shared
  46. for url in urls {
  47. if application.canOpenURL(URL(string: url)!) {
  48. application.open(URL(string: url)!, options: [:], completionHandler: nil)
  49. return
  50. }
  51. }
  52. }
  53. }