I am trying to add a 3D Touch Preview & Commit Segue to my app, but for some reason whenever I try to peek in the iOS Simulator the area behind the view controller being peeked turns completely white, whereas it is meant to be blurred. This happened even when I tried implementing 3D Touch programatically in another app.
In the app where I did it using storyboards, I selected the following options for the segue:
And I tried to do it programatically in another app by following these steps (I have the same bug in that app too):
registerForPreviewing(with: self, sourceView: view)
in viewDidLoad
UIViewControllerPreviewingDelegate
as follows:
previewingContext(_:viewControllerForLocation:)
, fetch the correct indexPath, set the context's source rect to it, instantiate the detail navigation controller from the storyboard, and return it.previewingContext(_:commit:)
, push (viewControllerToCommit as? UINavigationController)?.rootViewController
onto the navigation stack.I'm not entirely sure whether this bug is specific to the iOS Simulator, since I don't have a 3D Touch enabled iOS device, but are there any additional steps required to correctly implement peeking and popping?
Here is an example of the bug that I'm encountering:
I managed to test the apps on a 3D Touch capable iOS device, and I can confirm that Peek and Pop works perfectly on the device with both apps. I have hence come to the conclusion that this is a simulator-specific bug.