- (id)initWithContentType:(unsigned long long)arg1 { SBIconController *sbIconC = [objc_getClass("SBIconController") sharedInstance]; UILongPressGestureRecognizer *shortcutMenuPeekGesture = MSHookIvar<UILongPressGestureRecognizer *>(self, "_shortcutMenuPeekGesture"); shortcutMenuPeekGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:sbIconC action:@selector(_handleShortcutMenuPeek:)]; [self addGestureRecognizer:shortcutMenuPeekGesture]; // add swipe-up alternative for those weren't able to get the longpress to edit to work UISwipeGestureRecognizer *swipeGest = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(revealMenuSwiped:)]; [swipeGest setDirection:4]; [self addGestureRecognizer:swipeGest]; return %orig; }
- (void)revealMenuSwiped:(id)arg1 { [self _handleSecondHalfLongPressTimer:nil]; } - (void)_updateJitter { // in case any error :) SBIconController *sbIconC = [objc_getClass("SBIconController") sharedInstance]; [sbIconC _dismissShortcutMenuAnimated:YES completionHandler:^{
}]; }
2.改变UIDevice与UIScreen对force的支持
// add support of Peek and Pop // something missing here ;) %hook UIScreen - (int)_forceTouchCapability { return1; } %end %hook UITraitCollection - (int)forceTouchCapability { return1; } %end %hook UIDevice - (BOOL)_supportsForceTouch { return YES; } - (BOOL)_supportsHapticFeedback { return YES; }