2016-04-02 21 views
0

UIAlertController gösteriyorum ve UIAlertAction görüntü denetleyicisini reddediyorum. IOS 9.3'ten önce çalışıyordu. Ancak iOS 9.3'te çalışmıyor. Aşağıdaki kod.Yapılandırılamıyor Denetimci Denetlenen iOS 9.3

let alertController = UIAlertController(title: "Logged In Successfully", message: "asda", preferredStyle: .Alert) 

// Create the actions 
    let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { UIAlertAction in 
          self.dismissViewControllerAnimated(true, completion: nil) 
         } 

         // Add the actions 
         alertController.addAction(okAction) 

         // Present the controller 
         self.presentViewController(alertController, animated: true, completion: nil) 

cevap

1

deneyin dismissViewControllerAnimated doğrultusunda aralık bırakalım ve OK tuşuna bastığınızda oraya gidiyor olmadığını kontrol etmek. Değilse

- bununla

UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { UIAlertAction in 
          self.dismissViewControllerAnimated(true, completion: nil) 
         } 

değiştirmek deneyin:

UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { _ in 
          self.dismissViewControllerAnimated(true, completion: nil) 
         } 
+0

Eklediğim mola noktaları. Alertcontroller çalışıyor ama ReleaseViewer çalışmıyor. –

+0

UIAlertAction parametresini _? Ile değiştirmeyi denediniz mi? – Roee84

İlgili konular