File tree 4 files changed +18
-4
lines changed
4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = "CYLTabBarController"
3
- s . version = "1.17.13 "
3
+ s . version = "1.17.14 "
4
4
s . summary = "Highly customizable tabBar and tabBarController for iOS"
5
5
s . description = "CYLTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController."
6
6
s . homepage = "https://github.com/ChenYilong/CYLTabBarController"
Original file line number Diff line number Diff line change @@ -363,7 +363,8 @@ - (void)setupTabImageViewDefaultOffset:(UIView *)tabBarButton {
363
363
*/
364
364
- (UIView *)hitTest : (CGPoint )point withEvent : (UIEvent *)event {
365
365
// 1. 边界情况:不能响应点击事件
366
- BOOL canNotResponseEvent = self.hidden || (self.alpha <= 0 .01f ) || (self.userInteractionEnabled == NO );
366
+
367
+ BOOL canNotResponseEvent = self.hidden || (self.alpha <= 0 .01f ) || (self.userInteractionEnabled == NO ) || (!self.superview ) || self.frame .size .width == 0 || self.frame .size .height == 0 ;
367
368
if (canNotResponseEvent) {
368
369
return nil ;
369
370
}
Original file line number Diff line number Diff line change @@ -49,10 +49,19 @@ typedef void (^CYLPushOrPopCallback)(NSArray<__kindof UIViewController *> *viewC
49
49
* Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器作为返回值返回。
50
50
@param index 需要选择的控制器在 `TabBar` 中的 index。
51
51
@return 最终被选择的控制器。
52
- @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。
52
+ @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类,该方法无 pop 动画 。
53
53
*/
54
54
- (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex : (NSUInteger )index ;
55
55
56
+ /* !
57
+ * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器作为返回值返回。
58
+ @param index 需要选择的控制器在 `TabBar` 中的 index。
59
+ @param animated 动画
60
+ @return 最终被选择的控制器。
61
+ @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。
62
+ */
63
+ - (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex : (NSUInteger )index animated : (BOOL )animated ;
64
+
56
65
/* !
57
66
* Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器在 `Block` 回调中返回。
58
67
@param index 需要选择的控制器在 `TabBar` 中的 index。
Original file line number Diff line number Diff line change @@ -16,11 +16,15 @@ @implementation UIViewController (CYLTabBarControllerExtention)
16
16
#pragma mark - public Methods
17
17
18
18
- (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex : (NSUInteger )index {
19
+ return [self cyl_popSelectTabBarChildViewControllerAtIndex: index animated: NO ];
20
+ }
21
+
22
+ - (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex : (NSUInteger )index animated : (BOOL )animated {
19
23
UIViewController *viewController = [self cyl_getViewControllerInsteadOfNavigationController ];
20
24
[viewController checkTabBarChildControllerValidityAtIndex: index ];
21
25
CYLTabBarController *tabBarController = [viewController cyl_tabBarController ];
22
26
tabBarController.selectedIndex = index ;
23
- [viewController.navigationController popToRootViewControllerAnimated: NO ];
27
+ [viewController.navigationController popToRootViewControllerAnimated: animated ];
24
28
UIViewController *selectedTabBarChildViewController = tabBarController.selectedViewController ;
25
29
return [selectedTabBarChildViewController cyl_getViewControllerInsteadOfNavigationController ];
26
30
}
You can’t perform that action at this time.
0 commit comments