Add additional initializer to allow for an alternate swipe delegate.
This commit is contained in:
parent
e92e87abb2
commit
607fa09388
@ -30,4 +30,6 @@
|
|||||||
|
|
||||||
- (nullable instancetype)initWithViewController:(nullable UIViewController<MFSwipeNavigationProtocol>*)delegate;
|
- (nullable instancetype)initWithViewController:(nullable UIViewController<MFSwipeNavigationProtocol>*)delegate;
|
||||||
|
|
||||||
|
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id<MFSwipeNavigationProtocol>)delegate;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -28,9 +28,13 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
|
|||||||
@implementation MFTabBarInteractor
|
@implementation MFTabBarInteractor
|
||||||
|
|
||||||
- (nullable instancetype)initWithViewController:(nullable UIViewController <MFSwipeNavigationProtocol>*)delegate {
|
- (nullable instancetype)initWithViewController:(nullable UIViewController <MFSwipeNavigationProtocol>*)delegate {
|
||||||
|
return [self initWithViewController:delegate delegate:delegate];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id<MFSwipeNavigationProtocol>)delegate {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
||||||
[delegate.view addGestureRecognizer:self.panGesture];
|
[viewController.view addGestureRecognizer:self.panGesture];
|
||||||
self.delegate = delegate;
|
self.delegate = delegate;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user