react-native-navigation的迁移库

InteractivePopGestureDelegate.m 1005B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // InteractivePopGestureDelegate.m
  3. // ReactNativeNavigation
  4. //
  5. // Created by Arman Dezfuli-Arjomandi on 1/10/19.
  6. // Copyright © 2019 Wix. All rights reserved.
  7. //
  8. #import "InteractivePopGestureDelegate.h"
  9. @implementation InteractivePopGestureDelegate
  10. - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
  11. if (self.navigationController.navigationBarHidden && self.navigationController.viewControllers.count > 1) {
  12. return YES;
  13. } else if (!self.navigationController.navigationBarHidden && self.originalDelegate == nil) {
  14. return YES;
  15. } else {
  16. return [self.originalDelegate gestureRecognizer:gestureRecognizer shouldReceiveTouch:touch];
  17. }
  18. }
  19. - (BOOL)respondsToSelector:(SEL)aSelector {
  20. if (aSelector == @selector(gestureRecognizer:shouldReceiveTouch:)) {
  21. return YES;
  22. } else {
  23. return [self.originalDelegate respondsToSelector:aSelector];
  24. }
  25. }
  26. - (id)forwardingTargetForSelector:(SEL)aSelector {
  27. return self.originalDelegate;
  28. }
  29. @end