KyleGoddard / KGFloatingDrawer

A floating navigation drawer with an interesting animated presentation written in Swift.
MIT License
499 stars 79 forks source link

Alert doesn't appear #33

Open zemadara opened 7 years ago

zemadara commented 7 years ago

Hello,

i want to show an UIAlertController from my KGFloatingDrawer, but when i click on my item, which must display the alert, it doesn't show anything and if i put my finger once again on the screen the alert appears.

It seems that without touching the screen the app doesn't know "where" to display the alert.

i use self.present(alert, animated: true, completion: nil) to show my alert from my KGFloatingDrawer

KyleGoddard commented 7 years ago

for the alert controller what is in the self.presentingViewController property?

zemadara commented 7 years ago

let alert = UIAlertController(title: title,
                                      message: message,
                                      preferredStyle: UIAlertControllerStyle.alert)
        let acceptetAction = UIAlertAction(title: otherButtonTitle, style: UIAlertActionStyle.default) {
            UIAlertAction in
            ...
        }
        let refusetAction = UIAlertAction(title: cancelButtonTitle, style: UIAlertActionStyle.default){
            UIAlertAction in

        }
        alert.addAction(refusetAction)
        alert.addAction(acceptetAction)

        self.present(alert, animated: true, completion: nil)`
KyleGoddard commented 7 years ago

So far I'm unable to replicate this issue. Using the following code I am able to display an alert with no issues, and no second tap.

` @IBAction func displayAlert(_ sender:AnyObject) { let alert = UIAlertController(title: "Alert!", message: "This is an alert message!", preferredStyle: UIAlertControllerStyle.alert) let dismissAction = UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.default, handler: nil) alert.addAction(dismissAction)

    self.present(alert, animated: true, completion: nil)
}
`

simulator screen shot dec 23 2016 9 30 07 am

zemadara commented 7 years ago

the problem is when you are you left Drawer opened, it's an action on the drawer not in ViewController

KyleGoddard commented 7 years ago

Okay. I'm out now, I'll try this asap.

KyleGoddard commented 7 years ago

I am able to replicate the issue and I'm looking into a fix.

zemadara commented 7 years ago

it will be great, thx