Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func askForTWMail(){
- if (Twitter.sharedInstance().session() != nil) {
- let shareMailVC=TWTRShareEmailViewController(completion: {(mail:String!, error:NSError!) in
- if (mail != nil) {
- print("GOT MAIL: (mail)")
- self.gotMail()
- }else{
- print("MAIL VC ERROR: (error)")
- }
- })
- println("PRESENT MAIL VC")
- self.presentViewController(shareMailVC, animated: true, completion: nil)
- }else{
- println("User not logged in")
- }
- }
- func gotMail(){
- var alertController=UIAlertController(title: "Some title", message: "Some message", preferredStyle: UIAlertControllerStyle.Alert)
- var okAction=UIAlertAction(title:"Yes", style: UIAlertActionStyle.Default) {
- UIAlertAction in
- //some action
- }
- var cancelAction=UIAlertAction(title:"No", style: UIAlertActionStyle.Cancel){
- UIAlertAction in
- //some action
- }
- alertController.addAction(okAction)
- alertController.addAction(cancelAction)
- self.presentViewController(alertController, animated: true, completion: nil)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement