7

I have implemented Force Touch in my app in the chat view. When a user force-touches the chat message bubble of the other user, his/her profile is presented. For some strange reason, when the message bubble is gently pressed, the interactive transition gets stuck and all that is visible is a screenshot of the view that is supposed to be phased out.

I've debugged this issue as well using the View Hierarchy Debugger and the UITransitionView is definitely the top-most view. The app does not crash - it is still running and the user can still receive messages but not view them, exit out of the screen, etc. because of the screenshot stuck on top.

Has anyone ever had any issues like this? Sounds like an Apple bug.

clemens
  • 16,716
  • 11
  • 50
  • 65
Stephen Paul
  • 2,762
  • 2
  • 21
  • 25

1 Answers1

0

I found a reason for this bug.

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

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

method to do this.

I just suddenly call this function twice (once in super class' viewDidLoad(), once in subview controller's), and when I remove once in my subview controller, this bug is fixed! Amazing...

It's still an Apple bug since it makes no sence for that happens. However, wish this answer can help developers who has the same issue with me.

FYI. I just browse your Github code, found no double calls for register method. Maybe there's other reason for this bug. You could try to remove register method in your UITableViewController's subclass. By the way, I reproduce this issue when a view controller use ComponentKit.

clemens
  • 16,716
  • 11
  • 50
  • 65
kimimaro
  • 1,263
  • 2
  • 12
  • 21