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.

93 lines
2.8 KiB

6 years ago
6 years ago
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. struct StringConstants {
  11. let descriptionText = "about_me_description_text".localized()
  12. let appVersionText = "app_version_text".localized()
  13. let followText = "follow_us_text".localized()
  14. let aboutGme = "about_gme_text".localized()
  15. }
  16. // language
  17. @IBOutlet weak var versionLabel: UILabel!
  18. @IBOutlet weak var descriptionLabel: UILabel!
  19. @IBOutlet weak var followUsTitleText: UILabel!
  20. @IBOutlet weak var versionTitleLabel: UILabel!
  21. let URLFacebookApp: String = "fb://profile/1129818613815224"
  22. let URLFacebookApp2: String = "fb://page/1129818613815224"
  23. let URLFacebookBrowser: String = "https://www.facebook.com/1129818613815224/"
  24. let URLLinkedInApp: String = "linkedin://company/gmeremit/"
  25. let URLLinkedInBrowser: String = "https://www.linkedin.com/company/gmeremit/"
  26. override func viewDidLoad() {
  27. super.viewDidLoad()
  28. self.versionLabel.text = Utility.getAppVersion()
  29. configureLanguage()
  30. }
  31. override func viewWillAppear(_ animated: Bool) {
  32. super.viewWillAppear(animated)
  33. self.setupNormalNavigation()
  34. self.navigationItem.title = StringConstants().aboutGme
  35. }
  36. override func didReceiveMemoryWarning() {
  37. super.didReceiveMemoryWarning()
  38. // Dispose of any resources that can be recreated.
  39. }
  40. func configureLanguage() {
  41. self.descriptionLabel.text = StringConstants().descriptionText
  42. self.followUsTitleText.text = StringConstants().followText
  43. self.versionTitleLabel.text = StringConstants().appVersionText
  44. }
  45. @IBAction func checkForUpdate(_ sender: Any) {
  46. }
  47. @IBAction func openLinkedIn(_ sender: Any) {
  48. UIApplication.tryURL(urls: [self.URLLinkedInApp,
  49. self.URLLinkedInBrowser
  50. ])
  51. }
  52. @IBAction func openFacebook(_ sender: Any) {
  53. UIApplication.tryURL(urls: [self.URLFacebookApp,
  54. self.URLFacebookApp2,
  55. self.URLFacebookBrowser
  56. ])
  57. }
  58. }
  59. extension UIApplication {
  60. class func tryURL(urls: [String]) {
  61. let application = UIApplication.shared
  62. for url in urls {
  63. if application.canOpenURL(URL(string: url)!) {
  64. if #available(iOS 10.0, *) {
  65. application.open(URL(string: url)!, options: [:], completionHandler: nil)
  66. } else {
  67. // Fallback on earlier versions
  68. }
  69. return
  70. }
  71. }
  72. }
  73. }