Skip to content

Commit e273c21

Browse files
committed
v1.2.1 fix typo
1 parent c204954 commit e273c21

7 files changed

+20
-30
lines changed

CYLTabBarController.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "CYLTabBarController"
3-
s.version = "1.2.0"
3+
s.version = "1.2.1"
44
s.summary = "Highly customizable tabBar and tabBarController for iOS"
55
s.description = "CYLTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController."
66
s.homepage = "https://github.com/ChenYilong/CYLTabBarController"

CYLTabBarController/CYLPlusButton.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
@class CYLTabBar;
3636

37-
extern UIButton<CYLPlusButtonSubclassing> *CYLExternPushlishButton;
37+
extern UIButton<CYLPlusButtonSubclassing> *CYLExternPlusButton;
3838

3939
@interface CYLPlusButton : UIButton
4040

CYLTabBarController/CYLPlusButton.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import "CYLPlusButton.h"
1010
#import "CYLTabBarController.h"
1111

12-
UIButton<CYLPlusButtonSubclassing> *CYLExternPushlishButton = nil;
12+
UIButton<CYLPlusButtonSubclassing> *CYLExternPlusButton = nil;
1313

1414
@implementation CYLPlusButton
1515

@@ -19,7 +19,7 @@ @implementation CYLPlusButton
1919
+ (void)registerSubclass {
2020
if ([self conformsToProtocol:@protocol(CYLPlusButtonSubclassing)]) {
2121
Class<CYLPlusButtonSubclassing> class = self;
22-
CYLExternPushlishButton = [class plusButton];
22+
CYLExternPlusButton = [class plusButton];
2323
}
2424
}
2525

CYLTabBarController/CYLTabBar.m

+7-9
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
3636
}
3737

3838
- (instancetype)sharedInit {
39-
if (CYLExternPushlishButton) {
40-
self.plusButton = CYLExternPushlishButton;
39+
if (CYLExternPlusButton) {
40+
self.plusButton = CYLExternPlusButton;
4141
[self addSubview:(UIButton *)self.plusButton];
4242
}
4343
[self setBackgroundImage:[self imageWithColor:[UIColor whiteColor]]];
@@ -46,7 +46,7 @@ - (instancetype)sharedInit {
4646

4747
- (void)layoutSubviews {
4848
[super layoutSubviews];
49-
if (!CYLExternPushlishButton) {
49+
if (!CYLExternPlusButton) {
5050
return;
5151
}
5252
CGFloat barWidth = self.frame.size.width;
@@ -74,7 +74,7 @@ - (void)layoutSubviews {
7474
NSUInteger plusButtonIndex;
7575
if ([[self.plusButton class] respondsToSelector:@selector(indexOfPlusButtonInTabBar)]) {
7676
if (CYLTabbarItemsCount % 2 == 0) {
77-
[NSException raise:@"CYLTabBarController" format:@"If the count of CYLTabbarControllers is not odd,there's no need to realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【中文】如果CYLTabbarControllers的个数不是奇数,会自动居中,你无需在你自定义的plusButton中实现`+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
77+
[NSException raise:@"CYLTabBarController" format:@"If the count of CYLTabbarControllers is not odd,there's no need to realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果CYLTabbarControllers的个数不是奇数,会自动居中,你无需在你自定义的plusButton中实现`+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
7878
}
7979
plusButtonIndex = [[self.plusButton class] indexOfPlusButtonInTabBar];
8080
//仅修改self.plusButton的x,ywh值不变
@@ -85,7 +85,7 @@ - (void)layoutSubviews {
8585
);
8686
} else {
8787
if (CYLTabbarItemsCount % 2 != 0) {
88-
[NSException raise:@"CYLTabBarController" format:@"If the count of CYLTabbarControllers is odd,you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【中文】如果CYLTabbarControllers的个数是奇数,你必须在你自定义的plusButton中实现`+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
88+
[NSException raise:@"CYLTabBarController" format:@"If the count of CYLTabbarControllers is odd,you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果CYLTabbarControllers的个数是奇数,你必须在你自定义的plusButton中实现`+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
8989
}
9090
plusButtonIndex = CYLTabbarItemsCount / 2.0;
9191
}
@@ -118,10 +118,8 @@ - (void)layoutSubviews {
118118
[self bringSubviewToFront:self.plusButton];
119119
}
120120

121-
/*
122-
*
123-
Capturing touches on a subview outside the frame of its superview
124-
*
121+
/**
122+
* Capturing touches on a subview outside the frame of its superview
125123
*/
126124
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
127125
if (!self.clipsToBounds && !self.hidden && self.alpha > 0) {

CYLTabBarController/CYLTabBarController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (void)setViewControllers:(NSArray *)viewControllers {
5454
_viewControllers = [viewControllers copy];
5555
if (_tabBarItemsAttributes) {
5656
if (_tabBarItemsAttributes.count != _viewControllers.count) {
57-
[NSException raise:@"CYLTabBarController" format:@"The count of CYLTabBarControllers is not equal to the count of tabBarItemsAttributes.【中文】设置_tabBarItemsAttributes属性时,请确保元素个数与控制器的个数相同,并在方法`-setViewControllers:`之前设置"];
57+
[NSException raise:@"CYLTabBarController" format:@"The count of CYLTabBarControllers is not equal to the count of tabBarItemsAttributes.【Chinese】设置_tabBarItemsAttributes属性时,请确保元素个数与控制器的个数相同,并在方法`-setViewControllers:`之前设置"];
5858
}
5959
}
6060
CYLTabbarItemsCount = [viewControllers count];
@@ -100,7 +100,7 @@ - (void)addOneChildViewController:(UIViewController *)viewController
100100
}
101101

102102
+ (BOOL)havePlusButton {
103-
if (CYLExternPushlishButton) {
103+
if (CYLExternPlusButton) {
104104
return YES;
105105
}
106106
return NO;

Example/Classes/CYLTabBarControllerConfig.m

+6-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ @interface CYLBaseNavigationController : UINavigationController
1414
@implementation CYLBaseNavigationController
1515

1616
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
17-
// fix strange animate when use `-[UIViewController cyl_jumpToOtherTabBarControllerItem:(Class)ClassType performSelector:arguments:returnValue:]` ,like this http://i63.tinypic.com/bg766g.jpg .
17+
// fix strange animate when use `-[UIViewController cyl_jumpToOtherTabBarControllerItem:(Class)ClassType performSelector:arguments:returnValue:]` ,like this http://i63.tinypic.com/bg766g.jpg . If you have not used this method delete this line blow.
1818
[(CYLTabBarController *)self.tabBarController rootWindow].backgroundColor = [UIColor whiteColor];
1919
if (self.viewControllers.count > 0) {
2020
viewController.hidesBottomBarWhenPushed = YES;
@@ -63,11 +63,7 @@ - (CYLTabBarController *)tabBarController {
6363
initWithRootViewController:fourthViewController];
6464
CYLTabBarController *tabBarController = [[CYLTabBarController alloc] init];
6565

66-
/*
67-
*
68-
在`-setViewControllers:`之前设置TabBar的属性,设置TabBarItem的属性,包括 title、Image、selectedImage。
69-
*
70-
*/
66+
// 在`-setViewControllers:`之前设置TabBar的属性,设置TabBarItem的属性,包括 title、Image、selectedImage。
7167
[self setUpTabBarItemsAttributesForController:tabBarController];
7268

7369
[tabBarController setViewControllers:@[
@@ -76,20 +72,16 @@ - (CYLTabBarController *)tabBarController {
7672
thirdNavigationController,
7773
fourthNavigationController
7874
]];
79-
/**
80-
* 更多TabBar自定义设置:比如:tabBarItem 的选中和不选中文字和背景图片属性、tabbar 背景图片属性
81-
*/
75+
// 更多TabBar自定义设置:比如:tabBarItem 的选中和不选中文字和背景图片属性、tabbar 背景图片属性
8276
#warning IF YOU NEED CUSTOMIZE TABBAR APPEARANCE, REMOVE THE COMMENT '//'
8377
// [[self class] customizeTabBarAppearance:tabBarController];
8478
_tabBarController = tabBarController;
8579
}
8680
return _tabBarController;
8781
}
8882

89-
/*
90-
*
91-
在`-setViewControllers:`之前设置TabBar的属性,设置TabBarItem的属性,包括 title、Image、selectedImage。
92-
*
83+
/**
84+
* 在`-setViewControllers:`之前设置TabBar的属性,设置TabBarItem的属性,包括 title、Image、selectedImage。
9385
*/
9486
- (void)setUpTabBarItemsAttributesForController:(CYLTabBarController *)tabBarController {
9587

@@ -133,7 +125,7 @@ + (void)customizeTabBarAppearance:(CYLTabBarController *)tabBarController {
133125
// set the text color for unselected state
134126
// 普通状态下的文字属性
135127
NSMutableDictionary *normalAttrs = [NSMutableDictionary dictionary];
136-
normalAttrs[NSForegroundColorAttributeName] = [UIColor blackColor];
128+
normalAttrs[NSForegroundColorAttributeName] = [UIColor grayColor];
137129

138130
// set the text color for selected state
139131
// 选中状态下的文字属性

Example/Classes/Main/View/CYLPlusButtonSubclass.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (void)layoutSubviews {
5656
}
5757

5858
#pragma mark -
59-
#pragma mark - Public Methods
59+
#pragma mark - CYLPlusButtonSubclassing Methods
6060

6161
/*
6262
*

0 commit comments

Comments
 (0)