Merge branch 'feature/MFTabBarInteractor_additional_initializer' into 'develop'
Add additional initializer to allow for an alternate swipe delegate. See merge request BPHV_MIPS/mvm_core_ui!3
This commit is contained in:
commit
cf326ce0fd
@ -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