Setup
Two view controllers: A and B.
A allows the user to peek-and-pop into B using UIViewControllerPreviewingDelegate.
Observed Behavior
Peeking and then popping works as expected, but peeking and not following through with a pop often results in console warning:
"Warning: Attempt to dismiss from view controller <RootViewController: 0x107168050> while a presentation or dismiss is in progress!"
Repeating the interaction several times (peeking without popping) eventually causes the UI to freeze, with the background of A blurred and B being stuck in preview mode.
Overriding dismiss(:animated:) in B reveals it's called twice before viewDidDisappear() is called. The duplicate call to dismiss(:animated:) happens every time, and it's after the second call when the warning appears.
After spending the last few hours on this scouring the documentation and the internet, i'm left scratching my head. Has anyone encountered this or a similar issue? i'm running iOS 11.0.1 on an iPhone 6S and this is my first foray into Peek-and-Pop.
- number4