Guest User

Untitled

a guest
May 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. fileprivate func showBetaAlert(source: String) {
  2. let betaAlert = UIAlertController.betaProgramAlert()
  3. let joinAction = UIAlertAction(title: "Join", style: UIAlertActionStyle.default, handler: joinSelected(alert: <#UIAlertAction#>, source: source))
  4. let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: cancelSelected)
  5.  
  6. betaAlert.addAction(cancelAction)
  7. betaAlert.addAction(joinAction)
  8.  
  9. present(betaAlert, animated: true, completion: nil)
  10.  
  11. }
  12.  
  13. fileprivate func joinSelected(alert: UIAlertAction, source: String) {
  14. let betaAlert = UIAlertController.signUpAlert()
  15. let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: dismissEmailAction)
  16. let submitAction = UIAlertAction(title: "Submit", style: .default , handler: { [weak self] _ in
  17. guard let stelf = self else { return }
  18. let email = betaAlert.textFields![0] as UITextField
  19. stelf.submitAction(email: email.text!)
  20. })
  21.  
  22. betaAlert.addAction(cancelAction)
  23. betaAlert.addAction(submitAction)
  24.  
  25. present(betaAlert, animated: true, completion: nil)
  26. }
  27.  
  28. let joinAction = UIAlertAction(title: "Join", style: UIAlertActionStyle.default, handler: joinSelected(alert: <#UIAlertAction#>, source: source))
  29.  
  30. let joinAction = UIAlertAction(title: "Join", style: UIAlertActionStyle.default, handler: { [weak self] _ in
  31. joinSelected(source: source)
  32. })
  33.  
  34. fileprivate func joinSelected(source: String) {
Add Comment
Please, Sign In to add comment