Skip to content

Commit

Permalink
v1.12.1 change the way to judge UITabBarSwappableImageView from UITab…
Browse files Browse the repository at this point in the history
…BarSelectionIndicatorView

 -  avoid rejection by apple because of private API
  • Loading branch information
ChenYilong committed Jun 13, 2017
1 parent 0127b19 commit c3b7bb0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CYLTabBarController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CYLTabBarController"
s.version = "1.12.0"
s.version = "1.12.1"
s.summary = "Highly customizable tabBar and tabBarController for iOS"
s.description = "CYLTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController."
s.homepage = "https://github.com/ChenYilong/CYLTabBarController"
Expand Down
23 changes: 19 additions & 4 deletions CYLTabBarController/UIView+CYLTabBarControllerExtention.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ - (BOOL)cyl_isTabButton {

- (BOOL)cyl_isTabImageView {
BOOL isKindOfImageView = [self cyl_isKindOfClass:[UIImageView class]];
return isKindOfImageView;
if (!isKindOfImageView) {
return NO;
}
NSString *subString = [NSString stringWithFormat:@"%@cat%@ew", @"Indi" , @"orVi"];
BOOL isBackgroundImage = [self cyl_classStringContainsString:subString];
BOOL isTabImageView = !isBackgroundImage;
return isTabImageView;
}

- (BOOL)cyl_isTabLabel {
Expand All @@ -34,14 +40,23 @@ - (BOOL)cyl_isTabLabel {
- (BOOL)cyl_isKindOfClass:(Class)class {
BOOL isKindOfClass = [self isKindOfClass:class];
BOOL isClass = [self isMemberOfClass:class];
BOOL isKind = isKindOfClass && !isClass;
if (!isKind) {
return NO;
}
BOOL isTabBarClass = [self cyl_isTabBarClass];
return isKindOfClass && !isClass && isTabBarClass;
return isTabBarClass;
}

- (BOOL)cyl_isTabBarClass {
NSString *classString = NSStringFromClass([self class]);
NSString *tabBarClassString = [NSString stringWithFormat:@"U%@a%@ar", @"IT" , @"bB"];
if ([classString rangeOfString:tabBarClassString].location == NSNotFound) {
BOOL isTabBarClass = [self cyl_classStringContainsString:tabBarClassString];
return isTabBarClass;
}

- (BOOL)cyl_classStringContainsString:(NSString *)subString {
NSString *classString = NSStringFromClass([self class]);
if ([classString rangeOfString:subString].location == NSNotFound) {
return NO;
}
return YES;
Expand Down
3 changes: 3 additions & 0 deletions Example/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ - (void)addScaleAnimationOnView:(UIView *)animationView {

//旋转动画
- (void)addRotateAnimationOnView:(UIView *)animationView {
// 针对旋转动画,需要将旋转轴向屏幕外侧平移,最大图片宽度的一半
// 否则背景与按钮图片处于同一层次,当按钮图片旋转时,转轴就在背景图上,动画时会有一部分在背景图之下。
animationView.layer.zPosition = 65.f / 2;
[UIView animateWithDuration:0.32 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
animationView.layer.transform = CATransform3DMakeRotation(M_PI, 0, 1, 0);
} completion:nil];
Expand Down

0 comments on commit c3b7bb0

Please sign in to comment.