diff --git a/TABAnimated.podspec b/TABAnimated.podspec index e6b9a7f0..44df40b9 100755 --- a/TABAnimated.podspec +++ b/TABAnimated.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| #tag方式:填tag名称 #commit方式:填commit的id - s.version = "2.5.3" + s.version = "2.5.4" #库的简介 s.summary = "TABAnimated是一个ios平台上的网络过渡动画(骨架屏)的封装" @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.platform = :ios, "8.0" #库的地址 - s.source = { :git => "https://github.com/tigerAndBull/TABAnimated.git", :tag => "2.5.3" } + s.source = { :git => "https://github.com/tigerAndBull/TABAnimated.git", :tag => "2.5.4" } s.source_files = 'TABAnimatedDemo/TABAnimated/**/*.{h,m}' diff --git a/TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimationImpl.m b/TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimationImpl.m index f5386a53..38e26e41 100644 --- a/TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimationImpl.m +++ b/TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimationImpl.m @@ -34,7 +34,7 @@ - (CABasicAnimation *)scaleXAnimationDuration:(CGFloat)duration toValue:(CGFloat animation.duration = duration; animation.autoreverses = YES; animation.repeatCount = HUGE_VALF; - animation.toValue = (toValue == 0.)?@0.6:@(toValue); + animation.toValue = (toValue == 0.)? @0.6 : @(toValue); animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; return animation; } diff --git a/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.h b/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.h index d131fa17..781c1518 100755 --- a/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.h +++ b/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.h @@ -26,9 +26,19 @@ NS_ASSUME_NONNULL_BEGIN @interface TABComponentManager : NSObject +/** + * 获取单个动画元素 + * 使用方式:.animationN(x) + * x为字符串,映射组件的变量名 + * + * @return TABBaseComponent对象 + */ +- (TABBaseComponentStringBlock _Nullable)animationN; + /** * 获取单个动画元素 * 使用方式:.animation(x) + * x为int值 * * @return TABBaseComponent对象 */ diff --git a/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.m b/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.m index 58f7c397..2e5a1ab2 100755 --- a/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.m +++ b/TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentManager.m @@ -14,6 +14,8 @@ @interface TABComponentManager() @property (nonatomic, strong) NSMutableArray *components; @property (nonatomic, strong) NSMutableArray *layers; +@property (nonatomic, strong) NSMutableDictionary *dictComponents; + @property (nonatomic, strong) UIColor *animatedColor; @end @@ -36,27 +38,49 @@ - (instancetype)initWithBackgroundLayer:(TABComponentLayer *)backgroundLayer _animatedColor = animatedColor; _components = @[].mutableCopy; _layers = layers.mutableCopy; + _dictComponents = @{}.mutableCopy; _backgroundComponent = [TABBaseComponent componentWithLayer:backgroundLayer manager:self]; + for (NSInteger i = 0; i < _layers.count; i++) { TABComponentLayer *layer = _layers[i]; TABBaseComponent *component = [TABBaseComponent componentWithLayer:layer manager:self]; [_components addObject:component]; + if (layer.tagName) { + [_dictComponents addEntriesFromDictionary:@{ + layer.tagName : component + }]; + } } } return self; } +- (TABBaseComponentStringBlock _Nullable)animationN { + return [self animationWithName]; +} + +- (TABBaseComponentStringBlock _Nullable)animationWithName { + __weak typeof(self) weakSelf = self; + return ^TABBaseComponent *(NSString *name) { + if (!weakSelf.dictComponents[name]) { + NSAssert(NO, @"The name is not exist, please check it carefully."); + TABComponentLayer *layer = TABComponentLayer.new; + layer.loadStyle = TABViewLoadAnimationRemove; + return [TABBaseComponent componentWithLayer:layer manager:weakSelf]; + } + TABBaseComponent *component = weakSelf.dictComponents[name]; + return component; + }; +} + - (TABBaseComponentBlock _Nullable)animation { __weak typeof(self) weakSelf = self; return ^TABBaseComponent *(NSInteger index) { if (index >= weakSelf.components.count) { -#ifdef DEBUG NSAssert(NO, @"Array bound, please check it carefully."); -#else TABComponentLayer *layer = TABComponentLayer.new; layer.loadStyle = TABViewLoadAnimationRemove; return [TABBaseComponent componentWithLayer:layer manager:weakSelf]; -#endif } return weakSelf.components[index]; }; @@ -67,11 +91,8 @@ - (TABBaseComponentArrayBlock _Nullable)animations { return ^NSArray *(NSInteger location, NSInteger length) { if (location + length > weakSelf.components.count) { -#ifdef DEBUG NSAssert(NO, @"Array bound, please check it carefully."); -#else return @[]; -#endif } NSMutableArray *tempArray = @[].mutableCopy; @@ -104,11 +125,8 @@ - (TABBaseComponentArrayWithIndexsBlock)animationsWithIndexs { if(arg < 0) continue; if (arg > 1000) break; if (arg >= weakSelf.components.count) { -#ifdef DEBUG NSAssert(NO, @"如果运行到此断言,先检查是否调用了超过数组下标的index。若是确定没有,请取消使用该方法,使用单个获取的方式"); -#else break; -#endif } [resultArray addObject:weakSelf.components[arg]]; diff --git a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.h b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.h index 83dd21e9..14d4d608 100755 --- a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.h +++ b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.h @@ -17,10 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @interface TABAnimatedProductHelper : NSObject /// 填充数据, 并启动嵌套的view -/// @param view view -/// @param isHidden 是否隐藏子view -/// @param rootView 最初始view - + (void)fullDataAndStartNestAnimation:(UIView *)view isHidden:(BOOL)isHidden rootView:(UIView *)rootView; ++ (void)fullDataAndStartNestAnimation:(UIView *)view isHidden:(BOOL)isHidden superView:(UIView *)superView rootView:(UIView *)rootView; /** 恢复数据 diff --git a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.m b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.m index ddb338ff..9a77c889 100755 --- a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.m +++ b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductHelper.m @@ -14,17 +14,47 @@ #import "UIView+TABAnimatedProduction.h" #import "UIView+TABControlModel.h" #import "UIView+TABControlAnimation.h" +#import +#import "UIView+TABAnimated.h" static NSString * const kShortFillString = @" "; // 16 static NSString * const kLongFillString = @" "; // 48 -static const CGFloat kTagDefaultFontSize = 12.f; +static const CGFloat kTagDefaultFontSize = 10.f; static const CGFloat kTagLabelHeight = 20.f; static const CGFloat kTagLabelMinWidth = 15.f; @implementation TABAnimatedProductHelper -+ (void)fullDataAndStartNestAnimation:(UIView *)view isHidden:(BOOL)isHidden rootView:(UIView *)rootView { ++ (void)nameWithInstance:(UIView *)instance + superObject:(UIView *)superObject { + unsigned int numIvars = 0; + NSString *key = nil; + Ivar *ivars = class_copyIvarList(superObject.class, &numIvars); + for (int i = 0; i < numIvars; i++) { + Ivar thisIvar = ivars[i]; + const char *type = ivar_getTypeEncoding(thisIvar); + NSString *stringType = [NSString stringWithCString:type encoding:NSUTF8StringEncoding]; + if (![stringType hasPrefix:@"@"]) { + continue; + } + + UIView *thisObject = object_getIvar(superObject, thisIvar); + if (thisObject == instance) { + key = [NSString stringWithUTF8String:ivar_getName(thisIvar)]; + if (key && key.length > 0) { + if ([[key substringWithRange:NSMakeRange(0, 1)] isEqualToString:@"_"]) { + thisObject.tab_name = [key substringFromIndex:1]; + }else { + thisObject.tab_name = key; + } + } + } + } + free(ivars); +} + ++ (void)fullDataAndStartNestAnimation:(UIView *)view isHidden:(BOOL)isHidden superView:(UIView *)superView rootView:(UIView *)rootView { if ([view isKindOfClass:[UITableView class]] || [view isKindOfClass:[UICollectionView class]]) { @@ -39,7 +69,16 @@ + (void)fullDataAndStartNestAnimation:(UIView *)view isHidden:(BOOL)isHidden roo for (int i = 0; i < subViews.count; i++) { UIView *subV = subViews[i]; - [self fullDataAndStartNestAnimation:subV isHidden:isHidden rootView:rootView]; + + UIView *targetView; + if (![NSStringFromClass(subV.class) hasPrefix:@"UI"]) { + targetView = subV; + }else { + targetView = view; + } + [self fullDataAndStartNestAnimation:subV isHidden:isHidden superView:targetView rootView:rootView]; + + [TABAnimatedProductHelper nameWithInstance:subV superObject:superView]; if ([subV isKindOfClass:[UITableView class]] || [subV isKindOfClass:[UICollectionView class]]) { if (subV.tabAnimated) { @@ -219,7 +258,11 @@ + (TABComponentLayer *)getBackgroundLayerWithView:(UIView *)view controlView:(UI + (void)addTagWithComponentLayer:(TABComponentLayer *)layer isLines:(BOOL)isLines { CATextLayer *textLayer = [CATextLayer layer]; CGFloat width = layer.frame.size.width > kTagLabelMinWidth ? layer.frame.size.width : kTagLabelMinWidth; - textLayer.string = [NSString stringWithFormat:@"%ld",(long)layer.tagIndex]; + if (layer.tagName.length > 0) { + textLayer.string = [NSString stringWithFormat:@"%@ %ld", layer.tagName, (long)layer.tagIndex]; + }else { + textLayer.string = [NSString stringWithFormat:@"%ld", (long)layer.tagIndex]; + } if (isLines) { textLayer.frame = CGRectMake(0, 0, width, kTagLabelHeight); }else if (layer.origin != TABComponentLayerOriginImageView) { @@ -229,7 +272,7 @@ + (void)addTagWithComponentLayer:(TABComponentLayer *)layer isLines:(BOOL)isLine } textLayer.contentsScale = ([[UIScreen mainScreen] scale] > 3.0) ? [[UIScreen mainScreen] scale] : 3.0; textLayer.fontSize = kTagDefaultFontSize; - textLayer.alignmentMode = kCAAlignmentRight; + textLayer.alignmentMode = kCAAlignmentCenter; textLayer.foregroundColor = UIColor.redColor.CGColor; [layer addSublayer:textLayer]; } diff --git a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.m b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.m index 2ad88132..c3b4428e 100755 --- a/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.m +++ b/TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.m @@ -25,6 +25,7 @@ #import "TABAnimationManagerImpl.h" #import "TABAnimated.h" +#import "UIView+TABAnimated.h" @interface TABAnimatedProductImpl() { // self存在即存在 @@ -316,7 +317,7 @@ - (void)_productBackgroundLayerWithView:(UIView *)view needReset:(BOOL)needReset - (void)_productWithView:(UIView *)view needReset:(BOOL)needReset isCard:(BOOL)isCard { [self.weakTargetViewArray addPointer:(__bridge void * _Nullable)(view)]; - [TABAnimatedProductHelper fullDataAndStartNestAnimation:view isHidden:!needReset rootView:view]; + [TABAnimatedProductHelper fullDataAndStartNestAnimation:view isHidden:!needReset superView:view rootView:view]; [view layoutSubviews]; view.hidden = YES; @@ -409,6 +410,7 @@ - (void)_recurseProductLayerWithView:(UIView *)view layer = [self _createLayerWithView:subV needRemove:needRemove color:animatedColor isCard:isCard]; layer.serializationImpl = _controlView.tabAnimated.serializationImpl; layer.tagIndex = self->_targetTagIndex; + layer.tagName = subV.tab_name; [array addObject:layer]; _targetTagIndex++; } diff --git a/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.h b/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.h index d51dfbbe..23bfdb2e 100755 --- a/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.h +++ b/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.h @@ -76,6 +76,11 @@ typedef NS_ENUM(NSInteger, TABComponentLayerOrigin) { */ @property (nonatomic, assign) NSInteger tagIndex; +/** + * 该动画元素基于UIView映射的属性名 + */ +@property (nonatomic, copy) NSString *tagName; + #pragma mark - 配置成多行的动画元素 /** diff --git a/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.m b/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.m index fba30e10..51b1cd69 100755 --- a/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.m +++ b/TABAnimatedDemo/TABAnimated/Product/TABComponentLayer.m @@ -30,6 +30,9 @@ - (instancetype)init { _spaceDict = @{}.mutableCopy; _widthDict = @{}.mutableCopy; _heightDict = @{}.mutableCopy; +#ifdef DEBUG + self.masksToBounds = NO; +#endif } return self; } @@ -108,8 +111,10 @@ - (void)_addLinesLayer:(TABComponentLayer *)layer animatedHeight:(CGFloat)animat TABViewLoadAnimationStyle loadStyle = layer.loadStyle; BOOL withoutAnimation = layer.withoutAnimation; NSInteger tagIndex = layer.tagIndex; + NSString *tagName = layer.tagName; TABComponentLayerOrigin origin = layer.origin; + CGFloat textHeight; if (animatedHeight > 0.) { textHeight = animatedHeight; @@ -158,6 +163,7 @@ - (void)_addLinesLayer:(TABComponentLayer *)layer animatedHeight:(CGFloat)animat if (i == lines - 1) { sub.tagIndex = tagIndex; + sub.tagName = tagName; #ifdef DEBUG // 添加红色标记 if ([TABAnimated sharedAnimated].openAnimationTag) @@ -226,6 +232,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { [aCoder encodeObject:_widthDict forKey:@"widthDict"]; [aCoder encodeObject:_heightDict forKey:@"heightDict"]; [aCoder encodeObject:_spaceDict forKey:@"spaceDict"]; + [aCoder encodeObject:_tagName forKey:@"tagName"]; } - (id)initWithCoder:(NSCoder *)aDecoder { @@ -270,6 +277,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder { self.widthDict = [aDecoder decodeObjectForKey:@"widthDict"]; self.heightDict = [aDecoder decodeObjectForKey:@"heightDict"]; self.spaceDict = [aDecoder decodeObjectForKey:@"spaceDict"]; + self.tagName = [aDecoder decodeObjectForKey:@"tagName"]; } if (self.serializationImpl) { @@ -325,6 +333,7 @@ - (id)copyWithZone:(NSZone *)zone { layer.widthDict = self.widthDict; layer.heightDict = self.heightDict; layer.spaceDict = self.spaceDict; + layer.tagName = self.tagName; if(self.lineLayers.count != 0) { layer.lineLayers = @[].mutableCopy; diff --git a/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.h b/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.h new file mode 100644 index 00000000..67de6842 --- /dev/null +++ b/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.h @@ -0,0 +1,19 @@ +// +// UIView+TABAnimated.h +// TABAnimatedDemo +// +// Created by wenhuan on 2021/4/27. +// Copyright © 2021 tigerAndBull. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView (TABAnimated) + +@property (nonatomic, copy) NSString *tab_name; + +@end + +NS_ASSUME_NONNULL_END diff --git a/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.m b/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.m new file mode 100644 index 00000000..54bf1ebf --- /dev/null +++ b/TABAnimatedDemo/TABAnimated/Util/UIView+TABAnimated.m @@ -0,0 +1,22 @@ +// +// UIView+TABAnimated.m +// TABAnimatedDemo +// +// Created by wenhuan on 2021/4/27. +// Copyright © 2021 tigerAndBull. All rights reserved. +// + +#import "UIView+TABAnimated.h" +#import + +@implementation UIView (TABAnimated) + +- (NSString *)tab_name { + return objc_getAssociatedObject(self, @selector(tab_name)); +} + +- (void)setTab_name:(NSString *)tab_name { + objc_setAssociatedObject(self, @selector(tab_name), tab_name, OBJC_ASSOCIATION_COPY); +} + +@end diff --git a/TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.pbxproj b/TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.pbxproj index b86a9581..e898ce68 100755 --- a/TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.pbxproj +++ b/TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 2039EF7521DA07F200AE09FC /* NestCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2039EF7421DA07F200AE09FC /* NestCollectionViewCell.m */; }; 2039EF7821DA135900AE09FC /* BaseCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2039EF7621DA135900AE09FC /* BaseCollectionCell.m */; }; 2039EF7B21DA15C100AE09FC /* ImageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2039EF7A21DA15C100AE09FC /* ImageCollectionViewCell.m */; }; + 203B66E22637C6D400CD556B /* UIView+TABAnimated.m in Sources */ = {isa = PBXBuildFile; fileRef = 203B66E12637C6D400CD556B /* UIView+TABAnimated.m */; }; 20410A55261721620030575B /* NSArray+TABAnimated.m in Sources */ = {isa = PBXBuildFile; fileRef = 20410A54261721620030575B /* NSArray+TABAnimated.m */; }; 20410A5C261CA46B0030575B /* TABComponentLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 20410A5A261CA46A0030575B /* TABComponentLayer.m */; }; 205664D42489038700AC16D9 /* PullLoadingTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 205664D32489038700AC16D9 /* PullLoadingTableViewController.m */; }; @@ -207,6 +208,8 @@ 2039EF7721DA135900AE09FC /* BaseCollectionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCollectionCell.h; sourceTree = ""; }; 2039EF7921DA15C100AE09FC /* ImageCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCollectionViewCell.h; sourceTree = ""; }; 2039EF7A21DA15C100AE09FC /* ImageCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageCollectionViewCell.m; sourceTree = ""; }; + 203B66E02637C6D400CD556B /* UIView+TABAnimated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+TABAnimated.h"; sourceTree = ""; }; + 203B66E12637C6D400CD556B /* UIView+TABAnimated.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+TABAnimated.m"; sourceTree = ""; }; 20410A53261721620030575B /* NSArray+TABAnimated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+TABAnimated.h"; sourceTree = ""; }; 20410A54261721620030575B /* NSArray+TABAnimated.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+TABAnimated.m"; sourceTree = ""; }; 20410A5A261CA46A0030575B /* TABComponentLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TABComponentLayer.m; sourceTree = ""; }; @@ -1028,6 +1031,8 @@ 688A37CE24893B3D00A76894 /* UIScrollView+TABExtension.m */, 20410A53261721620030575B /* NSArray+TABAnimated.h */, 20410A54261721620030575B /* NSArray+TABAnimated.m */, + 203B66E02637C6D400CD556B /* UIView+TABAnimated.h */, + 203B66E12637C6D400CD556B /* UIView+TABAnimated.m */, ); path = Util; sourceTree = ""; @@ -1855,6 +1860,7 @@ 688A37E124893B3D00A76894 /* TABAnimatedCacheModel.m in Sources */, 688A380024893B3E00A76894 /* UIView+TABAnimatedProduction.m in Sources */, 681567332264214F00293AB4 /* UIColor+JXAdd.m in Sources */, + 203B66E22637C6D400CD556B /* UIView+TABAnimated.m in Sources */, 68D20752228BE55400B32CD1 /* DoubanCollectionViewController.m in Sources */, 6815671E2264214F00293AB4 /* JXCategoryDotCell.m in Sources */, 68C1719E246043B3004FD76F /* PartialSectionWithHeaderViewController.m in Sources */, diff --git a/TABAnimatedDemo/TABAnimatedDemo/Base/Controller/BaseDemoViewController.m b/TABAnimatedDemo/TABAnimatedDemo/Base/Controller/BaseDemoViewController.m index ec32378f..903b11d5 100755 --- a/TABAnimatedDemo/TABAnimatedDemo/Base/Controller/BaseDemoViewController.m +++ b/TABAnimatedDemo/TABAnimatedDemo/Base/Controller/BaseDemoViewController.m @@ -58,64 +58,64 @@ - (void)reloadViewAnimated { } -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewDidZoom:(UIScrollView *)scrollView API_AVAILABLE(ios(3.2)) { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -// called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may be changed to adjust where the scroll view comes to rest -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -// called on finger up if the user dragged. decelerate is true if it will continue moving afterwards -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); - return nil; -} - -- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view API_AVAILABLE(ios(3.2)) { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); - return NO; -} - -- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} - -- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView API_AVAILABLE(ios(11.0), tvos(11.0)) { - NSLog(@"%@", NSStringFromSelector(_cmd)); -} +//- (void)scrollViewDidScroll:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewDidZoom:(UIScrollView *)scrollView API_AVAILABLE(ios(3.2)) { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//// called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may be changed to adjust where the scroll view comes to rest +//- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//// called on finger up if the user dragged. decelerate is true if it will continue moving afterwards +//- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +// return nil; +//} +// +//- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view API_AVAILABLE(ios(3.2)) { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +// return NO; +//} +// +//- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} +// +//- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView API_AVAILABLE(ios(11.0), tvos(11.0)) { +// NSLog(@"%@", NSStringFromSelector(_cmd)); +//} @end diff --git a/TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionViewController.m b/TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionViewController.m index dc71b239..f4b9691c 100644 --- a/TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionViewController.m +++ b/TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionViewController.m @@ -152,9 +152,9 @@ - (UITableView *)tableView { _tableView.tabAnimated = [TABTableAnimated animatedWithCellClass:[TestTableViewCell class] cellHeight:100]; _tableView.tabAnimated.canLoadAgain = YES; _tableView.tabAnimated.adjustBlock = ^(TABComponentManager * _Nonnull manager) { - manager.animation(1).down(3).height(12); - manager.animation(2).height(12).reducedWidth(70); - manager.animation(3).down(-5).height(12).radius(0.).reducedWidth(-20); + manager.animationN(@"titleLab").down(3).height(12); + manager.animationN(@"timeLab").height(12).reducedWidth(70); + manager.animationN(@"statusBtn").down(-5).height(12).radius(0.).reducedWidth(-20); }; } return _tableView;