3D Touch Peek View Will not slide up for action

I have a tabular view. On 3D Touch, I view pdf in QLPreviewController format. Glance and pop work as intended.

For some reason, I can't get the preview controller to slide up and show my actions. I am returning a valid UIPreviewActionItems array in (NSArray<id<UIPreviewActionItem>> *)previewActionItems .

For some reason, when peek is displayed, no sliding up moves the preview, and no actions become visible, as I see in other applications.

+8
ios uitableview 3dtouch qlpreviewcontroller
source share
4 answers

I am also stuck on this. Make sure your -previewActionItems method is in the view controller that you are viewing.

Documentation for -previewActionItems

+30
source share

I had the same issue and was returning -previewActionsItems from my view view controller.

I forgot that I wrapped this in a UINavigationController, which is technically a preview controller that performs a preview. I threw this in a subclass to get around it:

 - (NSArray<id<UIPreviewActionItem>> *)previewActionItems { return self.topViewController.previewActionItems; } 
+7
source share

previewActionItems should be added to the ViewController that you want to view not in the register ViewController forPreviewingWithDelegate

+2
source share

Now you need to redefine the property, not the function.

 override var previewActionItems: [UIPreviewActionItem] { return previewActions } 
+1
source share

All Articles