Skip to content

Commit d3a87a2

Browse files
committed
v1.4.5 use more elegant implication for AirBnb-style(only show icon)
1 parent c3a1a26 commit d3a87a2

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CYLTabBarController.podspec

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
Pod::Spec.new do |s|
22
s.name = "CYLTabBarController"
3-
s.version = "1.4.4"
3+
s.version = "1.4.5"
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"
77
s.license = { :type => 'MIT', :file => 'LICENSE' }
88
s.author = { "ChenYilong" => "luohanchenyilong@163.com" }
9+
s.social_media_url = 'http://weibo.com/luohanchenyilong/'
910
s.platform = :ios, '7.0'
1011
s.source = { :git => "https://github.com/ChenYilong/CYLTabBarController.git", :tag => s.version.to_s }
1112
s.source_files = 'CYLTabBarController', 'CYLTabBarController/**/*.{h,m}'
13+
s.public_header_files = 'CYLTabBarController/**/*.h'
1214
s.requires_arc = true
1315
end

CYLTabBarController/CYLTabBar.m

+2-3
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ - (void)setupSwappableImageViewDefaultOffset:(UIView *)tabBarButton {
195195
__block CGFloat swappableImageViewDefaultOffset = 0.f;
196196
CGFloat tabBarHeight = self.frame.size.height;
197197
[tabBarButton.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
198-
if ([[obj class] isSubclassOfClass:[UILabel class]]) {
198+
if ([obj isKindOfClass:NSClassFromString(@"UITabBarButtonLabel")]) {
199199
shouldCustomizeImageView = NO;
200200
}
201201
swappableImageViewHeight = obj.frame.size.height;
202-
BOOL isNotSelectionIndicatorView = swappableImageViewHeight < (tabBarHeight - 5);
203-
BOOL isSwappableImageView = ([[obj class] isSubclassOfClass:[UIImageView class]]) && isNotSelectionIndicatorView;
202+
BOOL isSwappableImageView = [obj isKindOfClass:NSClassFromString(@"UITabBarSwappableImageView")];
204203
if (isSwappableImageView) {
205204
swappableImageViewDefaultOffset = (tabBarHeight - swappableImageViewHeight) * 0.5 * 0.5;
206205
}

CYLTabBarController/CYLTabBarController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ - (void)offsetTabBarSwappableImageViewToFit:(CGFloat)swappableImageViewDefaultOf
228228
UIEdgeInsets imageInset = UIEdgeInsetsMake(swappableImageViewDefaultOffset, 0, -swappableImageViewDefaultOffset, 0);
229229
obj.imageInsets = imageInset;
230230
if (!self.shouldCustomizeTitlePositionAdjustment) {
231-
obj.titlePositionAdjustment = UIOffsetMake(0, MAXFLOAT);;
231+
obj.titlePositionAdjustment = UIOffsetMake(0, MAXFLOAT);
232232
}
233233
}];
234234
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
<p align="center">
5-
![enter image description here](https://img.shields.io/badge/pod-v1.4.4-brightgreen.svg)
5+
![enter image description here](https://img.shields.io/badge/pod-v1.4.5-brightgreen.svg)
66
![enter image description here](https://img.shields.io/badge/Swift-compatible-orange.svg) ![enter image description here](https://img.shields.io/badge/platform-iOS%207.0%2B-ff69b5618733984.svg)
77
</a>
88

0 commit comments

Comments
 (0)