|
@@ -68,8 +68,40 @@
|
|
|
self.delegate = self;
|
|
|
[self setUpAllChildVc];
|
|
|
[self setSelectedIndex:0];
|
|
|
-
|
|
|
+ [self addTabBarClick];
|
|
|
// [self switchRootViewController];
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+-(void)addTabBarClick {
|
|
|
+ for (UIControl *tabBarButton in self.tabBar.subviews){
|
|
|
+ if ([tabBarButton isKindOfClass:NSClassFromString(@"UITabBarButton")] ||
|
|
|
+ [tabBarButton isKindOfClass:NSClassFromString(@"UIButton")]) {
|
|
|
+ [tabBarButton addTarget:self action:@selector(tabBarButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)tabBarButtonClick:(UIControl *)tabBarButton {
|
|
|
+ for (UIView *imageView in tabBarButton.subviews) {
|
|
|
+ if ([imageView isKindOfClass:NSClassFromString(@"UITabBarSwappableImageView")] ||
|
|
|
+ [imageView isKindOfClass:NSClassFromString(@"UIImageView")]) {
|
|
|
+ CAKeyframeAnimation *continueAimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
|
|
|
+ continueAimation.duration = 0.4f;
|
|
|
+ NSMutableArray *continueValues = [NSMutableArray array];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.6, 0.6, 1.0)]];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.2, 1.2, 1.0)]];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1, 1.1, 1.0)]];
|
|
|
+ [continueValues addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
|
|
|
+ continueAimation.values = continueValues;
|
|
|
+ continueAimation.removedOnCompletion = NO;
|
|
|
+ continueAimation.fillMode = kCAFillModeForwards;
|
|
|
+ [imageView.layer addAnimation:continueAimation forKey:nil];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//判断是否跳转
|
|
@@ -97,6 +129,7 @@
|
|
|
|
|
|
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
|
|
|
// NSLog(@"点击了第几个item:%ld",item.tag);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
#pragma mark - -----------------------------------------
|