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.
|
|
// // AboutGMEViewController.swift // GMERemittance // // Created by Sujal on 2/13/18. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. //
import UIKit
class AboutGMEViewController: UIViewController { struct StringConstants { let descriptionText = "about_me_description_text".localized() let appVersionText = "app_version_text".localized() let followText = "follow_us_text".localized() let aboutGme = "about_gme_text".localized() } // language @IBOutlet weak var versionLabel: UILabel! @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var followUsTitleText: UILabel! @IBOutlet weak var versionTitleLabel: UILabel! let URLFacebookApp: String = "fb://profile/1129818613815224" let URLFacebookApp2: String = "fb://page/1129818613815224" let URLFacebookBrowser: String = "https://www.facebook.com/1129818613815224/" let URLLinkedInApp: String = "linkedin://company/gmeremit/" let URLLinkedInBrowser: String = "https://www.linkedin.com/company/gmeremit/" override func viewDidLoad() { super.viewDidLoad() self.versionLabel.text = Utility.getAppVersion() configureLanguage() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.setupNormalNavigation() self.navigationItem.title = StringConstants().aboutGme }
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func configureLanguage() { self.descriptionLabel.text = StringConstants().descriptionText self.followUsTitleText.text = StringConstants().followText self.versionTitleLabel.text = StringConstants().appVersionText } @IBAction func checkForUpdate(_ sender: Any) { } @IBAction func openLinkedIn(_ sender: Any) { UIApplication.tryURL(urls: [self.URLLinkedInApp, self.URLLinkedInBrowser ]) } @IBAction func openFacebook(_ sender: Any) { UIApplication.tryURL(urls: [self.URLFacebookApp, self.URLFacebookApp2, self.URLFacebookBrowser ]) }
}
extension UIApplication { class func tryURL(urls: [String]) { let application = UIApplication.shared for url in urls { if application.canOpenURL(URL(string: url)!) { if #available(iOS 10.0, *) { application.open(URL(string: url)!, options: [:], completionHandler: nil) } else { // Fallback on earlier versions } return } } } }
|