Merge branch 'feature/edit_swipe_percentage' into 'develop'
allow user to overrise pannable Percentage value See merge request BPHV_MIPS/mvm_core_ui!57
This commit is contained in:
commit
90a44c90a8
@ -25,6 +25,9 @@
|
|||||||
// true while panning
|
// true while panning
|
||||||
@property (nonatomic) BOOL panning;
|
@property (nonatomic) BOOL panning;
|
||||||
|
|
||||||
|
//set pannable percentage 0 to 1
|
||||||
|
@property (nonatomic) CGFloat pannablePercentage;
|
||||||
|
|
||||||
// can be used to keep track of if we are ..
|
// can be used to keep track of if we are ..
|
||||||
@property (nonatomic) BOOL interactive;
|
@property (nonatomic) BOOL interactive;
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#import "MFTabBarInteractor.h"
|
#import "MFTabBarInteractor.h"
|
||||||
|
|
||||||
static CGFloat pannablePercentage = 0.15;
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
|
typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
|
||||||
MFTabBarPanningDirectionLeft,
|
MFTabBarPanningDirectionLeft,
|
||||||
MFTabBarPanningDirectionRight
|
MFTabBarPanningDirectionRight
|
||||||
@ -33,6 +31,7 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
|
|||||||
|
|
||||||
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id<MFSwipeNavigationProtocol>)delegate {
|
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController delegate:(nullable id<MFSwipeNavigationProtocol>)delegate {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
|
self.pannablePercentage = 0.15;
|
||||||
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
|
||||||
[viewController.view addGestureRecognizer:self.panGesture];
|
[viewController.view addGestureRecognizer:self.panGesture];
|
||||||
self.delegate = delegate;
|
self.delegate = delegate;
|
||||||
@ -48,8 +47,8 @@ typedef NS_ENUM(NSUInteger, MFTabBarPanningDirection) {
|
|||||||
|
|
||||||
// Simulates an edge gesture by only accepting pans at the edge of the screen. Needed because edge gesture doesn't work nicely with extended menus such as on ipad.
|
// Simulates an edge gesture by only accepting pans at the edge of the screen. Needed because edge gesture doesn't work nicely with extended menus such as on ipad.
|
||||||
CGRect frame = pan.view.frame;
|
CGRect frame = pan.view.frame;
|
||||||
CGRect pannableFrameLeft = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width*pannablePercentage, frame.size.height);
|
CGRect pannableFrameLeft = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width*self.pannablePercentage, frame.size.height);
|
||||||
CGRect pannableFrameRight = CGRectMake(frame.origin.x + frame.size.width*(1-pannablePercentage), frame.origin.y, frame.size.width*pannablePercentage, frame.size.height);
|
CGRect pannableFrameRight = CGRectMake(frame.origin.x + frame.size.width*(1-self.pannablePercentage), frame.origin.y, frame.size.width*self.pannablePercentage, frame.size.height);
|
||||||
|
|
||||||
switch (pan.state) {
|
switch (pan.state) {
|
||||||
case UIGestureRecognizerStateBegan:
|
case UIGestureRecognizerStateBegan:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user