SHARE
TWEET

Untitled

a guest Jul 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @IBAction func changeLanguage(_ sender: AnyObject) {
  2.         let actionSheet = UIAlertController(title: nil, message: "Switch Language", preferredStyle: UIAlertController.Style.actionSheet)
  3.         for language in Localize.availableLanguages() where language != "Base" {
  4.             let displayName = Localize.displayNameForLanguage(language)
  5.             let languageAction = UIAlertAction(title: displayName, style: .default, handler: {
  6.                 (alert: UIAlertAction!) -> Void in
  7.                 Localize.setCurrentLanguage(language)
  8.             })
  9.             actionSheet.addAction(languageAction)
  10.         }
  11.         let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: {
  12.             (alert: UIAlertAction) -> Void in
  13.         })
  14.         actionSheet.addAction(cancelAction)
  15.         self.present(actionSheet, animated: true, completion: nil)
  16.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top