Skip to content

Commit cc2a759

Browse files
committed
v1.12.0 avoid rejection by apple because of private API
1 parent 02368e4 commit cc2a759

File tree

12 files changed

+135
-49
lines changed

12 files changed

+135
-49
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ CYLTabBarController.xcodeproj/project.xcworkspace/xcuserdata/chenyilong.xcuserda
2222

2323

2424
CYLTabBarController.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
25+
*.xcuserstate
26+
*.xcbkptlist

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.11.0"
3+
s.version = "1.12.0"
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

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
9A1559DE1CB6D56500CAB1AF /* CYLDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1559D51CB6D56500CAB1AF /* CYLDetailsViewController.m */; };
1616
9A1559DF1CB6D56500CAB1AF /* CYLSameCityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1559D71CB6D56500CAB1AF /* CYLSameCityViewController.m */; };
1717
9A1559E41CB6EB1F00CAB1AF /* CYLPlusButtonSubclass.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1559E31CB6EB1F00CAB1AF /* CYLPlusButtonSubclass.m */; };
18+
9A474C0F1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A474C0E1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m */; };
1819
9AE667131C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE667121C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m */; };
1920
9AE942E71BDC933E00354519 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942CB1BDC933E00354519 /* LaunchScreen.xib */; };
2021
9AE942E81BDC933E00354519 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942CD1BDC933E00354519 /* Main.storyboard */; };
@@ -42,6 +43,8 @@
4243
9A1559D71CB6D56500CAB1AF /* CYLSameCityViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CYLSameCityViewController.m; sourceTree = "<group>"; };
4344
9A1559E21CB6EB1F00CAB1AF /* CYLPlusButtonSubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYLPlusButtonSubclass.h; sourceTree = "<group>"; };
4445
9A1559E31CB6EB1F00CAB1AF /* CYLPlusButtonSubclass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CYLPlusButtonSubclass.m; sourceTree = "<group>"; };
46+
9A474C0D1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+CYLTabBarControllerExtention.h"; sourceTree = "<group>"; };
47+
9A474C0E1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+CYLTabBarControllerExtention.m"; sourceTree = "<group>"; };
4548
9A5B29111D3475BC009E1BEE /* CYLConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CYLConstants.h; sourceTree = "<group>"; };
4649
9AE667111C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CYLTabBarControllerExtention.h"; sourceTree = "<group>"; };
4750
9AE667121C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+CYLTabBarControllerExtention.m"; sourceTree = "<group>"; };
@@ -202,6 +205,8 @@
202205
9AE942F41BDC937F00354519 /* CYLPlusButton.m */,
203206
9AE667111C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.h */,
204207
9AE667121C800085001DED12 /* UIViewController+CYLTabBarControllerExtention.m */,
208+
9A474C0D1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.h */,
209+
9A474C0E1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m */,
205210
9A5B29111D3475BC009E1BEE /* CYLConstants.h */,
206211
);
207212
path = CYLTabBarController;
@@ -287,6 +292,7 @@
287292
9A1559DB1CB6D56500CAB1AF /* CYLHomeViewController.m in Sources */,
288293
9AE942F91BDC937F00354519 /* CYLPlusButton.m in Sources */,
289294
9A1559C81CB6D4D300CAB1AF /* AppDelegate.m in Sources */,
295+
9A474C0F1EEFCCE200560ED1 /* UIView+CYLTabBarControllerExtention.m in Sources */,
290296
9A1559DD1CB6D56500CAB1AF /* CYLMineViewController.m in Sources */,
291297
9AE942FB1BDC937F00354519 /* CYLTabBarController.m in Sources */,
292298
9AE942F11BDC933E00354519 /* main.m in Sources */,

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

+20-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
symbolName = "-[CYLTabBarController setViewControllers:]"
6868
moduleName = "CYLTabBarController"
6969
usesParentBreakpointCondition = "Yes"
70-
urlString = "file:///Users/chenyilong/Documents/Git/%E7%AC%AC%E4%B8%89%E6%96%B9/CYLTabBarController/CYLTabBarController/CYLTabBarController.m"
71-
timestampString = "518268577.264112"
70+
urlString = "file:///Users/chenyilong/Documents/CYL/CYLTabBarController/CYLTabBarController/CYLTabBarController.m"
71+
timestampString = "519036622.139226"
7272
startingColumnNumber = "9223372036854775807"
7373
endingColumnNumber = "9223372036854775807"
7474
startingLineNumber = "206"
@@ -82,8 +82,8 @@
8282
symbolName = "-[CYLTabBarController setViewControllers:]"
8383
moduleName = "CYLTabBarController"
8484
usesParentBreakpointCondition = "Yes"
85-
urlString = "file:///Users/chenyilong/Documents/Git/%E7%AC%AC%E4%B8%89%E6%96%B9/CYLTabBarController/CYLTabBarController/CYLTabBarController.m"
86-
timestampString = "518268577.267085"
85+
urlString = "file:///Users/chenyilong/Documents/CYL/CYLTabBarController/CYLTabBarController/CYLTabBarController.m"
86+
timestampString = "519036622.140831"
8787
startingColumnNumber = "9223372036854775807"
8888
endingColumnNumber = "9223372036854775807"
8989
startingLineNumber = "206"
@@ -157,5 +157,21 @@
157157
landmarkType = "7">
158158
</BreakpointContent>
159159
</BreakpointProxy>
160+
<BreakpointProxy
161+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
162+
<BreakpointContent
163+
shouldBeEnabled = "Yes"
164+
ignoreCount = "0"
165+
continueAfterRunningActions = "No"
166+
filePath = "Example/AppDelegate.m"
167+
timestampString = "519035754.744564"
168+
startingColumnNumber = "9223372036854775807"
169+
endingColumnNumber = "9223372036854775807"
170+
startingLineNumber = "78"
171+
endingLineNumber = "78"
172+
landmarkName = "-tabBarController:didSelectControl:"
173+
landmarkType = "7">
174+
</BreakpointContent>
175+
</BreakpointProxy>
160176
</Breakpoints>
161177
</Bucket>

CYLTabBarController/CYLTabBar.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
@interface CYLTabBar : UITabBar
1212

1313
/*!
14-
* 让 `SwappableImageView` 垂直居中时,所需要的默认偏移量。
14+
* 让 `TabImageView` 垂直居中时,所需要的默认偏移量。
1515
* @attention 该值将在设置 top 和 bottom 时被同时使用,具体的操作等价于如下行为:
16-
* `viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(swappableImageViewDefaultOffset, 0, -swappableImageViewDefaultOffset, 0);`
16+
* `viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(tabImageViewDefaultOffset, 0, -tabImageViewDefaultOffset, 0);`
1717
*/
18-
@property (nonatomic, assign, readonly) CGFloat swappableImageViewDefaultOffset;
18+
@property (nonatomic, assign, readonly) CGFloat tabImageViewDefaultOffset;
1919

2020
@end

CYLTabBarController/CYLTabBar.m

+17-20
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ - (void)layoutSubviews {
7373
self.tabBarItemWidth = CYLTabBarItemWidth;
7474
NSArray *sortedSubviews = [self sortedSubviews];
7575
self.tabBarButtonArray = [self tabBarButtonFromTabBarSubviews:sortedSubviews];
76-
[self setupSwappableImageViewDefaultOffset:self.tabBarButtonArray[0]];
76+
[self setupTabImageViewDefaultOffset:self.tabBarButtonArray[0]];
7777
if (!CYLExternPlusButton) {
7878
return;
7979
}
@@ -131,11 +131,11 @@ - (void)setTabBarItemWidth:(CGFloat )tabBarItemWidth {
131131
}
132132
}
133133

134-
- (void)setSwappableImageViewDefaultOffset:(CGFloat)swappableImageViewDefaultOffset {
135-
if (swappableImageViewDefaultOffset != 0.f) {
136-
[self willChangeValueForKey:@"swappableImageViewDefaultOffset"];
137-
_swappableImageViewDefaultOffset = swappableImageViewDefaultOffset;
138-
[self didChangeValueForKey:@"swappableImageViewDefaultOffset"];
134+
- (void)setTabImageViewDefaultOffset:(CGFloat)tabImageViewDefaultOffset {
135+
if (tabImageViewDefaultOffset != 0.f) {
136+
[self willChangeValueForKey:@"tabImageViewDefaultOffset"];
137+
_tabImageViewDefaultOffset = tabImageViewDefaultOffset;
138+
[self didChangeValueForKey:@"tabImageViewDefaultOffset"];
139139
}
140140
}
141141

@@ -210,8 +210,7 @@ - (NSArray *)sortedSubviews {
210210
- (NSArray *)tabBarButtonFromTabBarSubviews:(NSArray *)tabBarSubviews {
211211
NSMutableArray *tabBarButtonMutableArray = [NSMutableArray arrayWithCapacity:tabBarSubviews.count - 1];
212212
[tabBarSubviews enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
213-
NSString *button = [NSString stringWithFormat:@"UIT%@arB%@", @"abB", @"utton"];
214-
if ([obj isKindOfClass:NSClassFromString(button)]) {
213+
if ([obj cyl_isTabButton]) {
215214
[tabBarButtonMutableArray addObject:obj];
216215
}
217216
}];
@@ -221,28 +220,26 @@ - (NSArray *)tabBarButtonFromTabBarSubviews:(NSArray *)tabBarSubviews {
221220
return [tabBarButtonMutableArray copy];
222221
}
223222

224-
- (void)setupSwappableImageViewDefaultOffset:(UIView *)tabBarButton {
223+
- (void)setupTabImageViewDefaultOffset:(UIView *)tabBarButton {
225224
__block BOOL shouldCustomizeImageView = YES;
226-
__block CGFloat swappableImageViewHeight = 0.f;
227-
__block CGFloat swappableImageViewDefaultOffset = 0.f;
225+
__block CGFloat tabImageViewHeight = 0.f;
226+
__block CGFloat tabImageViewDefaultOffset = 0.f;
228227
CGFloat tabBarHeight = self.frame.size.height;
229228
[tabBarButton.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
230-
NSString *label = [NSString stringWithFormat:@"UITa%@ut%@", @"bBarB", @"tonLabel"];
231-
if ([obj isKindOfClass:NSClassFromString(label)]) {
229+
if ([obj cyl_isTabLabel]) {
232230
shouldCustomizeImageView = NO;
233231
}
234-
swappableImageViewHeight = obj.frame.size.height;
235-
NSString *imageView = [NSString stringWithFormat:@"UITabB%@pp%@", @"arSwa", @"ableImageView"];
236-
BOOL isSwappableImageView = [obj isKindOfClass:NSClassFromString(imageView)];
237-
if (isSwappableImageView) {
238-
swappableImageViewDefaultOffset = (tabBarHeight - swappableImageViewHeight) * 0.5 * 0.5;
232+
tabImageViewHeight = obj.frame.size.height;
233+
BOOL isTabImageView = [obj cyl_isTabImageView];
234+
if (isTabImageView) {
235+
tabImageViewDefaultOffset = (tabBarHeight - tabImageViewHeight) * 0.5 * 0.5;
239236
}
240-
if (isSwappableImageView && swappableImageViewDefaultOffset == 0.f) {
237+
if (isTabImageView && tabImageViewDefaultOffset == 0.f) {
241238
shouldCustomizeImageView = NO;
242239
}
243240
}];
244241
if (shouldCustomizeImageView) {
245-
self.swappableImageViewDefaultOffset = swappableImageViewDefaultOffset;
242+
self.tabImageViewDefaultOffset = tabImageViewDefaultOffset;
246243
}
247244
}
248245

CYLTabBarController/CYLTabBarController.h

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

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

1213
FOUNDATION_EXTERN NSString *const CYLTabBarItemTitle;
1314
FOUNDATION_EXTERN NSString *const CYLTabBarItemImage;
@@ -22,7 +23,6 @@ FOUNDATION_EXTERN CGFloat CYLTabBarItemWidth;
2223
/*!
2324
* @param tabBarController The tab bar controller containing viewController.
2425
* @param control Selected UIControl in TabBar.
25-
* @attention If PlusButton also add an action, then this delegate method will not be invoked when the PlusButton is selected.
2626
*/
2727
- (void)tabBarController:(UITabBarController *)tabBarController didSelectControl:(UIControl *)control;
2828

CYLTabBarController/CYLTabBarController.m

+13-13
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
NSUInteger CYLPlusButtonIndex = 0;
2020
CGFloat CYLTabBarItemWidth = 0.0f;
2121
NSString *const CYLTabBarItemWidthDidChangeNotification = @"CYLTabBarItemWidthDidChangeNotification";
22-
static void * const CYLSwappableImageViewDefaultOffsetContext = (void*)&CYLSwappableImageViewDefaultOffsetContext;
22+
static void * const CYLTabImageViewDefaultOffsetContext = (void*)&CYLTabImageViewDefaultOffsetContext;
2323

2424
@interface CYLTabBarController () <UITabBarControllerDelegate>
2525

26-
@property (nonatomic, assign, getter=isObservingSwappableImageViewDefaultOffset) BOOL observingSwappableImageViewDefaultOffset;
26+
@property (nonatomic, assign, getter=isObservingTabImageViewDefaultOffset) BOOL observingTabImageViewDefaultOffset;
2727

2828
@end
2929
@implementation CYLTabBarController
@@ -38,9 +38,9 @@ - (void)viewDidLoad {
3838
// 处理tabBar,使用自定义 tabBar 添加 发布按钮
3939
[self setUpTabBar];
4040
// KVO注册监听
41-
if (!self.isObservingSwappableImageViewDefaultOffset) {
42-
[self.tabBar addObserver:self forKeyPath:@"swappableImageViewDefaultOffset" options:NSKeyValueObservingOptionNew context:CYLSwappableImageViewDefaultOffsetContext];
43-
self.observingSwappableImageViewDefaultOffset = YES;
41+
if (!self.isObservingTabImageViewDefaultOffset) {
42+
[self.tabBar addObserver:self forKeyPath:@"tabImageViewDefaultOffset" options:NSKeyValueObservingOptionNew context:CYLTabImageViewDefaultOffsetContext];
43+
self.observingTabImageViewDefaultOffset = YES;
4444
}
4545

4646
}
@@ -86,8 +86,8 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
8686

8787
- (void)dealloc {
8888
// KVO反注册
89-
if (self.isObservingSwappableImageViewDefaultOffset) {
90-
[self.tabBar removeObserver:self forKeyPath:@"swappableImageViewDefaultOffset"];
89+
if (self.isObservingTabImageViewDefaultOffset) {
90+
[self.tabBar removeObserver:self forKeyPath:@"tabImageViewDefaultOffset"];
9191
}
9292
}
9393

@@ -287,23 +287,23 @@ - (BOOL)shouldCustomizeTitlePositionAdjustment {
287287

288288
// KVO监听执行
289289
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
290-
if(context != CYLSwappableImageViewDefaultOffsetContext) {
290+
if(context != CYLTabImageViewDefaultOffsetContext) {
291291
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
292292
return;
293293
}
294-
if(context == CYLSwappableImageViewDefaultOffsetContext) {
295-
CGFloat swappableImageViewDefaultOffset = [change[NSKeyValueChangeNewKey] floatValue];
296-
[self offsetTabBarSwappableImageViewToFit:swappableImageViewDefaultOffset];
294+
if(context == CYLTabImageViewDefaultOffsetContext) {
295+
CGFloat tabImageViewDefaultOffset = [change[NSKeyValueChangeNewKey] floatValue];
296+
[self offsetTabBarTabImageViewToFit:tabImageViewDefaultOffset];
297297
}
298298
}
299299

300-
- (void)offsetTabBarSwappableImageViewToFit:(CGFloat)swappableImageViewDefaultOffset {
300+
- (void)offsetTabBarTabImageViewToFit:(CGFloat)tabImageViewDefaultOffset {
301301
if (self.shouldCustomizeImageInsets) {
302302
return;
303303
}
304304
NSArray<UITabBarItem *> *tabBarItems = [self cyl_tabBarController].tabBar.items;
305305
[tabBarItems enumerateObjectsUsingBlock:^(UITabBarItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
306-
UIEdgeInsets imageInset = UIEdgeInsetsMake(swappableImageViewDefaultOffset, 0, -swappableImageViewDefaultOffset, 0);
306+
UIEdgeInsets imageInset = UIEdgeInsetsMake(tabImageViewDefaultOffset, 0, -tabImageViewDefaultOffset, 0);
307307
obj.imageInsets = imageInset;
308308
if (!self.shouldCustomizeTitlePositionAdjustment) {
309309
obj.titlePositionAdjustment = UIOffsetMake(0, MAXFLOAT);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// CYLTabBarController.m
3+
// CYLTabBarController
4+
//
5+
// v1.10.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15.
6+
// Copyright © 2015 https://github.com/ChenYilong . All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface UIView (CYLTabBarControllerExtention)
12+
13+
- (BOOL)cyl_isPlusButton;
14+
- (BOOL)cyl_isTabButton;
15+
- (BOOL)cyl_isTabImageView;
16+
- (BOOL)cyl_isTabLabel;
17+
18+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// CYLTabBarController.m
3+
// CYLTabBarController
4+
//
5+
// v1.10.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15.
6+
// Copyright © 2015 https://github.com/ChenYilong . All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import "UIView+CYLTabBarControllerExtention.h"
11+
#import "CYLPlusButton.h"
12+
13+
@implementation UIView (CYLTabBarControllerExtention)
14+
15+
- (BOOL)cyl_isPlusButton {
16+
return [self isKindOfClass:[CYLExternPlusButton class]];
17+
}
18+
19+
- (BOOL)cyl_isTabButton {
20+
BOOL isKindOfButton = [self cyl_isKindOfClass:[UIControl class]];
21+
return isKindOfButton;
22+
}
23+
24+
- (BOOL)cyl_isTabImageView {
25+
BOOL isKindOfImageView = [self cyl_isKindOfClass:[UIImageView class]];
26+
return isKindOfImageView;
27+
}
28+
29+
- (BOOL)cyl_isTabLabel {
30+
BOOL isKindOfLabel = [self cyl_isKindOfClass:[UILabel class]];
31+
return isKindOfLabel;
32+
}
33+
34+
- (BOOL)cyl_isKindOfClass:(Class)class {
35+
BOOL isKindOfClass = [self isKindOfClass:class];
36+
BOOL isClass = [self isMemberOfClass:class];
37+
BOOL isTabBarClass = [self cyl_isTabBarClass];
38+
return isKindOfClass && !isClass && isTabBarClass;
39+
}
40+
41+
- (BOOL)cyl_isTabBarClass {
42+
NSString *classString = NSStringFromClass([self class]);
43+
NSString *tabBarClassString = [NSString stringWithFormat:@"U%@a%@ar", @"IT" , @"bB"];
44+
if ([classString rangeOfString:tabBarClassString].location == NSNotFound) {
45+
return NO;
46+
}
47+
return YES;
48+
}
49+
50+
@end

Example/AppDelegate.m

+4-7
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,13 @@ - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectView
7575

7676
- (void)tabBarController:(UITabBarController *)tabBarController didSelectControl:(UIControl *)control {
7777
UIView *animationView;
78-
NSString *button = [NSString stringWithFormat:@"UIT%@arB%@", @"abB", @"utton"];
79-
// 如果 PlusButton 也添加了点击事件,那么点击 PlusButton 后不会触发该代理方法。
80-
if ([control isKindOfClass:[CYLExternPlusButton class]]) {
78+
// 即使 PlusButton 也添加了点击事件,点击 PlusButton 后也会触发该代理方法。
79+
if ([control cyl_isPlusButton]) {
8180
UIButton *button = CYLExternPlusButton;
8281
animationView = button.imageView;
83-
84-
} else if ([control isKindOfClass:NSClassFromString(button)]) {
85-
NSString *imageView = [NSString stringWithFormat:@"UITabB%@pp%@", @"arSwa", @"ableImageView"];
82+
} else if ([control cyl_isTabButton]) {
8683
for (UIView *subView in control.subviews) {
87-
if ([subView isKindOfClass:NSClassFromString(imageView)]) {
84+
if ([subView cyl_isTabImageView]) {
8885
animationView = subView;
8986
}
9087
}

0 commit comments

Comments
 (0)