diff --git a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h index ca22d3f8..b08129f0 100644 --- a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h +++ b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.h @@ -30,4 +30,6 @@ - (nullable instancetype)initWithViewController:(nullable UIViewController*)delegate; +- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id)delegate; + @end diff --git a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m index 7557c47f..de20ef53 100644 --- a/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m +++ b/MVMCoreUI/Containers/TabBarController/MFTabBarInteractor.m @@ -28,9 +28,13 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) { @implementation MFTabBarInteractor - (nullable instancetype)initWithViewController:(nullable UIViewController *)delegate { + return [self initWithViewController:delegate delegate:delegate]; +} + +- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id)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;