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:
Hedden, Kyle Matthew 2019-03-05 17:35:40 -05:00
commit cf326ce0fd
2 changed files with 7 additions and 1 deletions

View File

@ -30,4 +30,6 @@
- (nullable instancetype)initWithViewController:(nullable UIViewController<MFSwipeNavigationProtocol>*)delegate;
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id<MFSwipeNavigationProtocol>)delegate;
@end

View File

@ -28,9 +28,13 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
@implementation MFTabBarInteractor
- (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]) {
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
[delegate.view addGestureRecognizer:self.panGesture];
[viewController.view addGestureRecognizer:self.panGesture];
self.delegate = delegate;
}
return self;