Closed fadylateef closed 7 years ago
Hi @fadylateef. Can you post the code here?
Thanks -Paolo
I'm using an action when the red close button tapped . Here's the code
import UIKit
class RecentlySearchedViewController: UIViewController ,UITableViewDelegate,UITableViewDataSource{
@IBAction func deleteTapped(_ sender: Any) {
let alert = PMAlertController(title: "Delete History", description: "Do you really want to delete recent searches ?!", image: nil, style: .alert)
alert.addAction(PMAlertAction(title: "Yes", style: .default, action: {kaka in
self.deleteRecents()
}))
alert.addAction(PMAlertAction(title: "No", style: .cancel, action: nil))
self.present(alert, animated: true, completion: nil)
}
}
Usually is not possibile to tap on another tab with PMAlertController showed.
I made a test project, and i don't have this type of error. Which controller is presenting PMAlertController? PMTabBarWithAlert.zip
Do you have some news about that?
I'm afraid , the same problem is standing. Maybe I've used the alert controller in wrong order of views hierarchy .
Thanks for due care .
On Thu, Dec 15, 2016 at 12:03 PM, Paolo Musolino notifications@github.com wrote:
Do you have some news about that?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Codeido/PMAlertController/issues/31#issuecomment-267288498, or mute the thread https://github.com/notifications/unsubscribe-auth/AQvIgT6NV-NxniENtQPU8xZG1FBNAbsiks5rIRBVgaJpZM4LKhus .
I have the same problem and it is not because of the view hierarchy. I was using PMAlertController from a subclass which then I call it from a the view in the tabbar. I tried removing the subclass and directly calling PMAlertController, I can still press on any tabbar Item and sometimes the screen is black. It was not doing the same behavior prior swift 3. I am not sure what the problem is for me.
@mn288 if you try to use UIAlertController, do you have the same problem?
Tried on another project and it's working fine. Using Xcode 8.2 beta and iOS 10.2.
I have the same issue while presenting from a subclass
Same problem here, I have to use this via:
guard let root = UIApplication.shared.keyWindow?.rootViewController else { return }
root.present(alert, animated: true, completion: nil)
I was having the same issue. I was able to overcome the problem by the help of @akring above.
I have 3 tab bar items with 3 different view controller. And I use PMAlertController for the first tab item, it works great but whenever I select another tab item and go back to the first one it gives black screen.
I think it may relate to super views and order of views .
Thanks in advance for the great library.