hybrid-navigation 2.15.6 → 2.15.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,12 @@ typedef void(^HBDButtonActionBlock)(void);
13
13
  @end
14
14
 
15
15
 
16
- @interface HBDBarButton : UIButton
16
+ @interface HBDImageBarButton : UIButton
17
17
 
18
18
  @property(nonatomic) UIEdgeInsets alignmentRectInsetsOverride;
19
19
 
20
20
  @end
21
+
22
+ @interface HBDTextBarButton : UIButton
23
+
24
+ @end
@@ -1,6 +1,6 @@
1
1
  #import "HBDBarButtonItem.h"
2
2
 
3
- @implementation HBDBarButton
3
+ @implementation HBDImageBarButton
4
4
 
5
5
  - (CGSize)intrinsicContentSize {
6
6
  return CGSizeMake(32, 32);
@@ -25,6 +25,10 @@
25
25
 
26
26
  @end
27
27
 
28
+ @implementation HBDTextBarButton
29
+
30
+ @end
31
+
28
32
  @interface HBDBarButtonItem ()
29
33
 
30
34
  @end
@@ -32,7 +36,7 @@
32
36
  @implementation HBDBarButtonItem
33
37
 
34
38
  - (instancetype)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style {
35
- HBDBarButton *button = [HBDBarButton buttonWithType:UIButtonTypeSystem];
39
+ HBDImageBarButton *button = [HBDImageBarButton buttonWithType:UIButtonTypeSystem];
36
40
  button.translatesAutoresizingMaskIntoConstraints = NO;
37
41
  [button setFrame:CGRectMake(0, 0, 32, 32)];
38
42
  [button setImage:image forState:UIControlStateNormal];
@@ -41,7 +45,11 @@
41
45
  }
42
46
 
43
47
  - (instancetype)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style {
44
- return [super initWithTitle:title style:style target:self action:@selector(didButtonClick)];
48
+ UIButton *button = [HBDTextBarButton buttonWithType:UIButtonTypeSystem];
49
+ button.translatesAutoresizingMaskIntoConstraints = NO;
50
+ [button setTitle:title forState:UIControlStateNormal];
51
+ [button addTarget:self action:@selector(didButtonClick) forControlEvents:UIControlEventTouchUpInside];
52
+ return [super initWithCustomView:button];
45
53
  }
46
54
 
47
55
  - (void)didButtonClick {
@@ -69,6 +69,11 @@
69
69
 
70
70
  - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
71
71
  HBDNavigationController *nav = self.nav;
72
+
73
+ if (nav.transitionCoordinator) {
74
+ return NO;
75
+ }
76
+
72
77
  if (nav.viewControllers.count > 1) {
73
78
  UIViewController *topVC = nav.topViewController;
74
79
  return topVC.hbd_swipeBackEnabled && topVC.hbd_backInteractive;
@@ -22,8 +22,8 @@
22
22
 
23
23
  UIBarButtonItem *buttonItem = [self createBarButtonItem:item];
24
24
  UIView *customView = buttonItem.customView;
25
- if ([customView isKindOfClass:[HBDBarButton class]]) {
26
- HBDBarButton *button = (HBDBarButton *)customView;
25
+ if ([customView isKindOfClass:[HBDImageBarButton class]]) {
26
+ HBDImageBarButton *button = (HBDImageBarButton *)customView;
27
27
  button.imageEdgeInsets = buttonItem.imageInsets;
28
28
  button.alignmentRectInsetsOverride = UIEdgeInsetsMake(0, 4, 0, -4);
29
29
  }
@@ -48,8 +48,8 @@
48
48
 
49
49
  UIBarButtonItem *buttonItem = [self createBarButtonItem:item];
50
50
  UIView *customView = buttonItem.customView;
51
- if ([customView isKindOfClass:[HBDBarButton class]]) {
52
- HBDBarButton *button = (HBDBarButton *)customView;
51
+ if ([customView isKindOfClass:[HBDImageBarButton class]]) {
52
+ HBDImageBarButton *button = (HBDImageBarButton *)customView;
53
53
  button.imageEdgeInsets = buttonItem.imageInsets;
54
54
  button.alignmentRectInsetsOverride = UIEdgeInsetsMake(0, -4, 0, 4);
55
55
  }
@@ -77,8 +77,8 @@
77
77
  for (NSUInteger i = 0; i < barButtonItems.count; i++) {
78
78
  UIBarButtonItem *buttonItem = barButtonItems[i];
79
79
  UIView *customView = buttonItem.customView;
80
- if ([customView isKindOfClass:[HBDBarButton class]]) {
81
- HBDBarButton *button = (HBDBarButton *)customView;
80
+ if ([customView isKindOfClass:[HBDImageBarButton class]]) {
81
+ HBDImageBarButton *button = (HBDImageBarButton *)customView;
82
82
  button.imageEdgeInsets = buttonItem.imageInsets;
83
83
  button.alignmentRectInsetsOverride = UIEdgeInsetsMake(0, 4, 0, -4);
84
84
  }
@@ -104,8 +104,8 @@
104
104
  for (NSUInteger i = 0; i < barButtonItems.count; i++) {
105
105
  UIBarButtonItem *buttonItem = barButtonItems[i];
106
106
  UIView *customView = buttonItem.customView;
107
- if ([customView isKindOfClass:[HBDBarButton class]]) {
108
- HBDBarButton *button = (HBDBarButton *)customView;
107
+ if ([customView isKindOfClass:[HBDImageBarButton class]]) {
108
+ HBDImageBarButton *button = (HBDImageBarButton *)customView;
109
109
  button.imageEdgeInsets = buttonItem.imageInsets;
110
110
  button.alignmentRectInsetsOverride = UIEdgeInsetsMake(0, -4, 0, 4);
111
111
  }
@@ -159,8 +159,8 @@
159
159
  if (tintColor) {
160
160
  barButtonItem.tintColor = [HBDUtils colorWithHexString:tintColor];
161
161
  UIView *customView = barButtonItem.customView;
162
- if ([customView isKindOfClass:[HBDBarButton class]]) {
163
- HBDBarButton *button = (HBDBarButton *) customView;
162
+ if ([customView isKindOfClass:[HBDImageBarButton class]] || [customView isKindOfClass:[HBDTextBarButton class]]) {
163
+ UIButton *button = (UIButton *)customView;
164
164
  button.tintColor = [HBDUtils colorWithHexString:tintColor];
165
165
  }
166
166
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.15.6",
4
+ "version": "2.15.7",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",