User:Nicolas17/MobileMail/MessageViewController/previewActionForSwipeAction:withMessage:forSwipe:

From iPhone Development Wiki
< User:Nicolas17‎ | MobileMail
Revision as of 20:29, 14 February 2016 by Nicolas17 (talk | contribs) (Split reversing info into a section)
-(UIPreviewAction*)_previewActionForSwipeAction:(unsigned long long)action withMessage:(id)message forSwipe:(BOOL)swipe;

This method in MessageViewController creates a UIPreviewAction object (action shown in the 3D Touch "peek" view). It's called by leadingPreviewAction and trailingPreviewAction to get the actions on the sides of the peek, and by _previewActionsForSwipeActions:excludingSwipeActions: for the actions at the bottom.

Reverse engineering info

I'm starting to decompile this method and will put the pseudocode in this page.

This method contains two jump tables (at least in arm64), presumably compiled from switch statements, which Hopper doesn't handle automatically even in the disassembly, and it will be a bit of a pain to figure them out manually.