Skip to content

Commit 6ebf5db

Browse files
committed
1.17.3 support mutli-tabbar
1 parent 1edd0ff commit 6ebf5db

23 files changed

+588
-176
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.17.2"
3+
s.version = "1.17.3"
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.xcodeproj/project.pbxproj

+17-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
9A474B5A1EF03D1B0020D132 /* UITabBarItem+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A474B591EF03D1B0020D132 /* UITabBarItem+CYLTabBarControllerExtention.m */; };
1919
9A474B5D1EF1586C0020D132 /* UIControl+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A474B5C1EF1586C0020D132 /* UIControl+CYLTabBarControllerExtention.m */; };
2020
9A474C0F1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A474C0E1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m */; };
21+
9AC0181B1FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AC0181A1FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.m */; };
2122
9AE667131C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE667121C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m */; };
2223
9AE942E71BDC933E00354519 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942CB1BDC933E00354519 /* LaunchScreen.xib */; };
2324
9AE942E81BDC933E00354519 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942CD1BDC933E00354519 /* Main.storyboard */; };
@@ -52,6 +53,8 @@
5253
9A474C0D1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+CYLTabBarControllerExtention.h"; sourceTree = "<group>"; };
5354
9A474C0E1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+CYLTabBarControllerExtention.m"; sourceTree = "<group>"; };
5455
9A5B29111D3475BC009E1BEE /* CYLConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CYLConstants.h; sourceTree = "<group>"; };
56+
9AC018191FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CYLPlusDemoChildViewController.h; sourceTree = "<group>"; };
57+
9AC0181A1FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CYLPlusDemoChildViewController.m; sourceTree = "<group>"; };
5558
9AE667111C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CYLTabBarControllerExtention.h"; sourceTree = "<group>"; };
5659
9AE667121C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+CYLTabBarControllerExtention.m"; sourceTree = "<group>"; };
5760
9AE942741BDC91B800354519 /* CYLTabBarController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CYLTabBarController.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -84,6 +87,7 @@
8487
9A1559C91CB6D56500CAB1AF /* Module */ = {
8588
isa = PBXGroup;
8689
children = (
90+
9AC018181FE90A70001EC2D6 /* Other */,
8791
9A1559CA1CB6D56500CAB1AF /* Home */,
8892
9A1559CD1CB6D56500CAB1AF /* Message */,
8993
9A1559D01CB6D56500CAB1AF /* Mine */,
@@ -139,6 +143,15 @@
139143
path = View;
140144
sourceTree = "<group>";
141145
};
146+
9AC018181FE90A70001EC2D6 /* Other */ = {
147+
isa = PBXGroup;
148+
children = (
149+
9AC018191FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.h */,
150+
9AC0181A1FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.m */,
151+
);
152+
path = Other;
153+
sourceTree = "<group>";
154+
};
142155
9AE9426B1BDC91B800354519 = {
143156
isa = PBXGroup;
144157
children = (
@@ -253,7 +266,7 @@
253266
TargetAttributes = {
254267
9AE942731BDC91B800354519 = {
255268
CreatedOnToolsVersion = 6.3;
256-
DevelopmentTeam = Y6X8P44TM5;
269+
DevelopmentTeam = QBMN2BBW3K;
257270
};
258271
};
259272
};
@@ -309,6 +322,7 @@
309322
9AE942FB1BDC937F00354519 /* CYLTabBarController.m in Sources */,
310323
9AE942F11BDC933E00354519 /* main.m in Sources */,
311324
9AE942FA1BDC937F00354519 /* CYLTabBar.m in Sources */,
325+
9AC0181B1FE90AA1001EC2D6 /* CYLPlusDemoChildViewController.m in Sources */,
312326
);
313327
runOnlyForDeploymentPostprocessing = 0;
314328
};
@@ -424,6 +438,7 @@
424438
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
425439
CODE_SIGN_IDENTITY = "iPhone Developer";
426440
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
441+
DEVELOPMENT_TEAM = QBMN2BBW3K;
427442
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
428443
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
429444
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -440,6 +455,7 @@
440455
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
441456
CODE_SIGN_IDENTITY = "iPhone Developer";
442457
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
458+
DEVELOPMENT_TEAM = QBMN2BBW3K;
443459
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
444460
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
445461
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

CYLTabBarController.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

+66-24
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,37 @@
2020
ignoreCount = "0"
2121
continueAfterRunningActions = "No"
2222
filePath = "Example/CYLTabBarControllerConfig.m"
23-
timestampString = "534076601.296284"
23+
timestampString = "535433771.557124"
2424
startingColumnNumber = "9223372036854775807"
2525
endingColumnNumber = "9223372036854775807"
26-
startingLineNumber = "208"
27-
endingLineNumber = "208"
26+
startingLineNumber = "221"
27+
endingLineNumber = "221"
2828
landmarkName = "+imageWithColor:size:"
2929
landmarkType = "7">
3030
</BreakpointContent>
3131
</BreakpointProxy>
32+
<BreakpointProxy
33+
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
34+
<BreakpointContent
35+
shouldBeEnabled = "Yes"
36+
ignoreCount = "0"
37+
continueAfterRunningActions = "No"
38+
scope = "0"
39+
stopOnStyle = "0">
40+
</BreakpointContent>
41+
</BreakpointProxy>
3242
<BreakpointProxy
3343
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
3444
<BreakpointContent
3545
shouldBeEnabled = "Yes"
3646
ignoreCount = "0"
3747
continueAfterRunningActions = "No"
3848
filePath = "CYLTabBarController/CYLTabBarController.m"
39-
timestampString = "534076601.296366"
49+
timestampString = "535433771.557928"
4050
startingColumnNumber = "9223372036854775807"
4151
endingColumnNumber = "9223372036854775807"
42-
startingLineNumber = "211"
43-
endingLineNumber = "211"
52+
startingLineNumber = "313"
53+
endingLineNumber = "313"
4454
landmarkName = "-setViewControllers:"
4555
landmarkType = "7">
4656
</BreakpointContent>
@@ -52,11 +62,11 @@
5262
ignoreCount = "0"
5363
continueAfterRunningActions = "No"
5464
filePath = "CYLTabBarController/CYLTabBarController.m"
55-
timestampString = "534076601.296789"
65+
timestampString = "535433771.558356"
5666
startingColumnNumber = "9223372036854775807"
5767
endingColumnNumber = "9223372036854775807"
58-
startingLineNumber = "209"
59-
endingLineNumber = "209"
68+
startingLineNumber = "314"
69+
endingLineNumber = "314"
6070
landmarkName = "-setViewControllers:"
6171
landmarkType = "7">
6272
</BreakpointContent>
@@ -67,13 +77,13 @@
6777
shouldBeEnabled = "Yes"
6878
ignoreCount = "0"
6979
continueAfterRunningActions = "No"
70-
filePath = "CYLTabBarController/CYLTabBarController.m"
71-
timestampString = "534076601.297083"
80+
filePath = "CYLTabBarController/CYLTabBar.m"
81+
timestampString = "535433771.558613"
7282
startingColumnNumber = "9223372036854775807"
7383
endingColumnNumber = "9223372036854775807"
74-
startingLineNumber = "270"
75-
endingLineNumber = "270"
76-
landmarkName = "-getImageFromImageInfo:"
84+
startingLineNumber = "138"
85+
endingLineNumber = "138"
86+
landmarkName = "-layoutSubviews"
7787
landmarkType = "7">
7888
</BreakpointContent>
7989
</BreakpointProxy>
@@ -83,13 +93,13 @@
8393
shouldBeEnabled = "Yes"
8494
ignoreCount = "0"
8595
continueAfterRunningActions = "No"
86-
filePath = "CYLTabBarController/CYLPlusButton.m"
87-
timestampString = "534076601.297364"
96+
filePath = "CYLTabBarController/UIView+CYLTabBarControllerExtention.m"
97+
timestampString = "535433771.558922"
8898
startingColumnNumber = "9223372036854775807"
8999
endingColumnNumber = "9223372036854775807"
90-
startingLineNumber = "48"
91-
endingLineNumber = "48"
92-
landmarkName = "-plusChildViewControllerButtonClicked:"
100+
startingLineNumber = "81"
101+
endingLineNumber = "81"
102+
landmarkName = "-cyl_tabBadgeBackgroundSeparator"
93103
landmarkType = "7">
94104
</BreakpointContent>
95105
</BreakpointProxy>
@@ -99,13 +109,45 @@
99109
shouldBeEnabled = "Yes"
100110
ignoreCount = "0"
101111
continueAfterRunningActions = "No"
102-
filePath = "CYLTabBarController/CYLTabBarController.m"
103-
timestampString = "534076601.297412"
112+
filePath = "CYLTabBarController/UIView+CYLTabBarControllerExtention.m"
113+
timestampString = "535433771.559161"
114+
startingColumnNumber = "9223372036854775807"
115+
endingColumnNumber = "9223372036854775807"
116+
startingLineNumber = "85"
117+
endingLineNumber = "85"
118+
landmarkName = "-cyl_tabBadgeBackgroundSeparator"
119+
landmarkType = "7">
120+
</BreakpointContent>
121+
</BreakpointProxy>
122+
<BreakpointProxy
123+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
124+
<BreakpointContent
125+
shouldBeEnabled = "Yes"
126+
ignoreCount = "0"
127+
continueAfterRunningActions = "No"
128+
filePath = "CYLTabBarController/UIView+CYLTabBarControllerExtention.m"
129+
timestampString = "535433771.559253"
130+
startingColumnNumber = "9223372036854775807"
131+
endingColumnNumber = "9223372036854775807"
132+
startingLineNumber = "76"
133+
endingLineNumber = "76"
134+
landmarkName = "-cyl_tabBadgeBackgroundSeparator"
135+
landmarkType = "7">
136+
</BreakpointContent>
137+
</BreakpointProxy>
138+
<BreakpointProxy
139+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
140+
<BreakpointContent
141+
shouldBeEnabled = "Yes"
142+
ignoreCount = "0"
143+
continueAfterRunningActions = "No"
144+
filePath = "CYLTabBarController/UIView+CYLTabBarControllerExtention.m"
145+
timestampString = "535433771.559326"
104146
startingColumnNumber = "9223372036854775807"
105147
endingColumnNumber = "9223372036854775807"
106-
startingLineNumber = "54"
107-
endingLineNumber = "54"
108-
landmarkName = "-viewDidLayoutSubviews"
148+
startingLineNumber = "74"
149+
endingLineNumber = "74"
150+
landmarkName = "-cyl_tabBadgeBackgroundSeparator"
109151
landmarkType = "7">
110152
</BreakpointContent>
111153
</BreakpointProxy>

CYLTabBarController/CYLPlusButton.h

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767

6868
+ (CGFloat)multiplerInCenterY CYL_DEPRECATED("Deprecated in 1.6.0. Use `+multiplierOfTabBarHeight:` instead.");
6969

70+
+ (NSString *)tabBarContext;
71+
7072
@end
7173

7274
@class CYLTabBar;

CYLTabBarController/CYLPlusButton.m

+17-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import "CYLPlusButton.h"
1010
#import "CYLTabBarController.h"
11+
#import "UIViewController+CYLTabBarControllerExtention.h"
1112

1213
CGFloat CYLPlusButtonWidth = 0.0f;
1314
UIButton<CYLPlusButtonSubclassing> *CYLExternPlusButton = nil;
@@ -28,11 +29,19 @@ + (void)registerPlusButton {
2829
CYLPlusButtonWidth = plusButton.frame.size.width;
2930
if ([[self class] respondsToSelector:@selector(plusChildViewController)]) {
3031
CYLPlusChildViewController = [class plusChildViewController];
32+
if ([[self class] respondsToSelector:@selector(tabBarContext)]) {
33+
NSString *tabBarContext = [class tabBarContext];
34+
if (tabBarContext && tabBarContext.length) {
35+
[CYLPlusChildViewController cyl_setContext:tabBarContext];
36+
}
37+
} else {
38+
[CYLPlusChildViewController cyl_setContext:NSStringFromClass([CYLTabBarController class])];
39+
}
3140
[[self class] addSelectViewControllerTarget:plusButton];
3241
if ([[self class] respondsToSelector:@selector(indexOfPlusButtonInTabBar)]) {
3342
CYLPlusButtonIndex = [[self class] indexOfPlusButtonInTabBar];
3443
} else {
35-
[NSException raise:@"CYLTabBarController" format:@"If you want to add PlusChildViewController, you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果你想使用PlusChildViewController样式,你必须同时在你自定义的plusButton中实现 `+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
44+
[NSException raise:NSStringFromClass([CYLTabBarController class]) format:@"If you want to add PlusChildViewController, you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果你想使用PlusChildViewController样式,你必须同时在你自定义的plusButton中实现 `+indexOfPlusButtonInTabBar`,来指定plusButton的位置"];
3645
}
3746
}
3847
}
@@ -53,7 +62,13 @@ - (void)plusChildViewControllerButtonClicked:(UIButton<CYLPlusButtonSubclassing>
5362
return;
5463
}
5564
sender.selected = YES;
56-
[self cyl_tabBarController].selectedIndex = CYLPlusButtonIndex;
65+
CYLTabBarController *tabBarController = [sender cyl_tabBarController];
66+
NSInteger index = [tabBarController.viewControllers indexOfObject:CYLPlusChildViewController];
67+
@try {
68+
[tabBarController setSelectedIndex:index];
69+
} @catch (NSException *exception) {
70+
NSLog(@"🔴类名与方法名:%@(在第%@行),描述:%@", @(__PRETTY_FUNCTION__), @(__LINE__), exception);
71+
}
5772
}
5873

5974
#pragma mark -

CYLTabBarController/CYLTabBar.h

+2
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
*/
1818
@property (nonatomic, assign, readonly) CGFloat tabImageViewDefaultOffset;
1919

20+
@property (nonatomic, copy) NSString *context;
21+
2022
@end

0 commit comments

Comments
 (0)