Touching Force Touch animation freezes if you lightly touch it.

I applied Force Touch in my app in chat mode. When a user clicks on another user's chat message bubble, their profile is displayed. For some strange reason, when the message bubble is gently pressed, the interactive transition gets stuck, and all that is visible is a screenshot that should be gradually turned off.

I also debugged this problem using the View Hierarchy Debugger, and UITransitionView is by far the top view. The application does not crash - it still works, and the user can still receive messages, but not view them, exit the screen, etc. Due to a screenshot stuck on top.

Has anyone had such problems? Sounds like an Apple bug.

+7
ios objective-c
source share
1 answer

I found the cause of this error.

If your view controller needs to support force preview, you need to register this view controller with a delegate by calling

 - (id <UIViewControllerPreviewing>)registerForPreviewingWithDelegate:(id<UIViewControllerPreviewingDelegate>)delegate sourceView:(UIView *)sourceView NS_AVAILABLE_IOS(9_0); 

to do this.

I just suddenly call this function twice (once in the superclass' viewDidLoad() , once in the subview controller), and when I delete once in my subview controller, this error is fixed! Amazing ...

This is still Apple's error, as it does not make any difference to this. However, I wish this answer helps developers who have the same problem with me.

Fyi. I am just looking through your Github code, did not find double calls for the register method. Maybe there is another reason for this error. You can try to remove the register method in your subclass of UITableViewController . By the way, I reproduce this problem when the view controller uses ComponentKit.

0
source share

All Articles