├── .github └── ISSUE_TEMPLATE │ └── bug-report-template.md ├── .gitignore ├── Documents ├── 上拉加载功能.md ├── 不再hook setDelegate和setDataSource.md ├── 全局:局部属性、链式语法api.md ├── 关于iOS14适配说明.md ├── 动画元素下标问题.md ├── 升级文档和其他修复.md ├── 实时预览.md ├── 实时预览工具.md ├── 嵌套视图详解.md ├── 暗黑模式骨架屏实现方案.md ├── 架构设计和性能测试.md ├── 缓存策略和线程处理.md ├── 豆瓣动画详解.md └── 问题答疑文档.md ├── LICENSE ├── README.md ├── README_EN.md ├── TABAnimated.podspec └── TABAnimatedDemo ├── TABAnimated ├── Cache │ ├── TABAnimatedCacheManager.h │ ├── TABAnimatedCacheManager.m │ ├── TABAnimatedCacheModel.h │ ├── TABAnimatedCacheModel.m │ ├── TABAnimatedDocumentMethod.h │ └── TABAnimatedDocumentMethod.m ├── Config │ └── TABAnimatedConfig.h ├── Control │ ├── Include │ │ └── TABViewAnimatedDefines.h │ ├── TABCollectionAnimated.h │ ├── TABCollectionAnimated.m │ ├── TABFormAnimated.h │ ├── TABFormAnimated.m │ ├── TABTableAnimated.h │ ├── TABTableAnimated.m │ ├── TABViewAnimated.h │ ├── TABViewAnimated.m │ ├── UICollectionView+TABControlAnimation.h │ ├── UICollectionView+TABControlAnimation.m │ ├── UITableView+TABControlAnimation.h │ ├── UITableView+TABControlAnimation.m │ ├── UIView+TABAnimated.h │ ├── UIView+TABAnimated.m │ ├── UIView+TABControlAnimation.h │ ├── UIView+TABControlAnimation.m │ ├── UIView+TABControlModel.h │ └── UIView+TABControlModel.m ├── Decorate │ ├── Animation │ │ ├── Bin │ │ │ ├── TABBinAnimation.h │ │ │ ├── TABBinAnimation.m │ │ │ ├── TABBinAnimationImpl.h │ │ │ └── TABBinAnimationImpl.m │ │ ├── Classic │ │ │ ├── TABBaseComponent+TABClassicAnimation.h │ │ │ ├── TABBaseComponent+TABClassicAnimation.m │ │ │ ├── TABClassicAnimation.h │ │ │ ├── TABClassicAnimation.m │ │ │ ├── TABClassicAnimationImpl.h │ │ │ ├── TABClassicAnimationImpl.m │ │ │ ├── TABComponentLayer+TABClassicAnimation.h │ │ │ ├── TABComponentLayer+TABClassicAnimation.m │ │ │ ├── TABComponentLayerClassicSerializationImpl.h │ │ │ └── TABComponentLayerClassicSerializationImpl.m │ │ ├── Drop │ │ │ ├── NSArray+TABDropAnimation.h │ │ │ ├── NSArray+TABDropAnimation.m │ │ │ ├── TABBaseComponent+TABDropAnimation.h │ │ │ ├── TABBaseComponent+TABDropAnimation.m │ │ │ ├── TABComponentLayer+TABDropAnimation.h │ │ │ ├── TABComponentLayer+TABDropAnimation.m │ │ │ ├── TABComponentLayerDropSerializationImpl.h │ │ │ ├── TABComponentLayerDropSerializationImpl.m │ │ │ ├── TABDropAnimation.h │ │ │ ├── TABDropAnimation.m │ │ │ ├── TABDropAnimationDefines.h │ │ │ ├── TABDropAnimationImpl.h │ │ │ └── TABDropAnimationImpl.m │ │ ├── Include │ │ │ ├── TABAnimatedDecorateInterface.h │ │ │ └── TABAnimationManagerInterface.h │ │ ├── Shimmer │ │ │ ├── TABShimmerAnimation.h │ │ │ ├── TABShimmerAnimation.m │ │ │ ├── TABShimmerAnimationDefines.h │ │ │ ├── TABShimmerAnimationImpl.h │ │ │ └── TABShimmerAnimationImpl.m │ │ ├── TABAnimationManagerImpl.h │ │ └── TABAnimationManagerImpl.m │ ├── Chain │ │ ├── Include │ │ │ ├── TABAnimatedChainDefines.h │ │ │ └── TABAnimatedChainManagerInterface.h │ │ ├── NSArray+TABAnimatedChain.h │ │ ├── NSArray+TABAnimatedChain.m │ │ ├── TABAnimatedChainManagerImpl.h │ │ ├── TABAnimatedChainManagerImpl.m │ │ ├── TABBaseComponent.h │ │ ├── TABBaseComponent.m │ │ ├── TABComponentManager.h │ │ ├── TABComponentManager.m │ │ ├── TABComponentMutableKey.h │ │ └── TABComponentMutableKey.m │ └── DarkMode │ │ ├── Include │ │ ├── TABAnimatedDarkModeDefines.h │ │ ├── TABAnimatedDarkModeInterface.h │ │ └── TABAnimatedDarkModeManagerInterface.h │ │ ├── TABAnimatedDarkModeImpl.h │ │ ├── TABAnimatedDarkModeImpl.m │ │ ├── TABAnimatedDarkModeManagerImpl.h │ │ ├── TABAnimatedDarkModeManagerImpl.m │ │ ├── TABSentryView.h │ │ └── TABSentryView.m ├── Product │ ├── Include │ │ ├── TABAnimatedProductDefines.h │ │ ├── TABAnimatedProductInterface.h │ │ └── TABComponentLayerSerializationInterface.h │ ├── TABAnimatedProductHelper.h │ ├── TABAnimatedProductHelper.m │ ├── TABAnimatedProductImpl.h │ ├── TABAnimatedProductImpl.m │ ├── TABAnimatedProduction.h │ ├── TABAnimatedProduction.m │ ├── TABComponentLayer.h │ ├── TABComponentLayer.m │ ├── UIView+TABAnimatedProduction.h │ └── UIView+TABAnimatedProduction.m ├── PullLoading │ ├── TABAnimatedPullLoadingComponent.h │ ├── TABAnimatedPullLoadingComponent.m │ ├── UIScrollView+TABAnimated.h │ ├── UIScrollView+TABAnimated.m │ ├── UIView+TABExtension.h │ └── UIView+TABExtension.m ├── TABAnimated.h ├── TABAnimated.m └── Util │ ├── NSArray+TABAnimated.h │ ├── NSArray+TABAnimated.m │ ├── TABAnimationMethod.h │ ├── TABAnimationMethod.m │ ├── TABWeakDelegateManager.h │ ├── TABWeakDelegateManager.m │ ├── UIScrollView+TABExtension.h │ └── UIScrollView+TABExtension.m ├── TABAnimatedDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ └── TABAnimatedDemo.xcscheme └── TABAnimatedDemo ├── AppConfig ├── AppDelegate.h ├── AppDelegate.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-Notification@2x-1.png │ │ ├── Icon-Notification@2x-2.png │ │ ├── Icon-Notification@2x.png │ │ ├── Icon-Notification@3x.png │ │ ├── Icon-Small-1.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x-1.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small@2x-1.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── icon.png │ ├── Contents.json │ └── placeholder.imageset │ │ ├── Contents.json │ │ ├── placeholder-1.png │ │ ├── placeholder-2.png │ │ └── placeholder.png ├── Info.plist ├── LaunchScreen.storyboard ├── TABAnimatedDemo.pch ├── en-IN.lproj │ └── Localizable.strings ├── en.lproj │ └── Localizable.strings ├── main.m └── zh-Hans.lproj │ └── Localizable.strings ├── Base ├── Category │ ├── UIColor+TABCategory.h │ ├── UIColor+TABCategory.m │ ├── UIImage+TABAnimatedDemo.h │ └── UIImage+TABAnimatedDemo.m ├── Cell │ ├── BaseCollectionCell.h │ └── BaseCollectionCell.m ├── Controller │ ├── BaseDemoViewController.h │ └── BaseDemoViewController.m ├── Model │ ├── Game.h │ ├── Game.m │ ├── News.h │ ├── News.m │ ├── TestBaseModel.h │ └── TestBaseModel.m ├── TABDefine.h ├── Util │ ├── UILabel+TABCategory.h │ └── UILabel+TABCategory.m └── View │ ├── TestCollectionView.h │ ├── TestCollectionView.m │ ├── TestTableView.h │ └── TestTableView.m ├── Sources ├── comic.jpg ├── head.jpg ├── long.jpg ├── placeholder.png ├── test.jpg ├── test0.jpg ├── test1.jpg ├── test2.jpg └── test3.jpg ├── TABInjectionIIIHelper.h ├── TABInjectionIIIHelper.m ├── Third ├── AlertView │ ├── TABPopBgView.h │ ├── TABPopBgView.m │ ├── TABPopViewController.h │ └── TABPopViewController.m ├── Gradient │ ├── UIButton+Gradient.h │ ├── UIButton+Gradient.m │ ├── UIImage+Gradient.h │ └── UIImage+Gradient.m ├── JXCategoryView │ └── Sources │ │ ├── Base │ │ ├── JXCategoryBaseCell.h │ │ ├── JXCategoryBaseCell.m │ │ ├── JXCategoryBaseCellModel.h │ │ ├── JXCategoryBaseCellModel.m │ │ ├── JXCategoryBaseView.h │ │ └── JXCategoryBaseView.m │ │ ├── Common │ │ ├── JXCategoryCollectionView.h │ │ ├── JXCategoryCollectionView.m │ │ ├── JXCategoryFactory.h │ │ ├── JXCategoryFactory.m │ │ ├── JXCategoryIndicatorParamsModel.h │ │ ├── JXCategoryIndicatorParamsModel.m │ │ ├── JXCategoryIndicatorProtocol.h │ │ ├── JXCategoryListCollectionContainerView.h │ │ ├── JXCategoryListCollectionContainerView.m │ │ ├── JXCategoryListContainerView.h │ │ ├── JXCategoryListContainerView.m │ │ ├── JXCategoryViewAnimator.h │ │ ├── JXCategoryViewAnimator.m │ │ ├── JXCategoryViewDefines.h │ │ ├── UIColor+JXAdd.h │ │ └── UIColor+JXAdd.m │ │ ├── Dot │ │ ├── JXCategoryDotCell.h │ │ ├── JXCategoryDotCell.m │ │ ├── JXCategoryDotCellModel.h │ │ ├── JXCategoryDotCellModel.m │ │ ├── JXCategoryDotView.h │ │ └── JXCategoryDotView.m │ │ ├── Image │ │ ├── JXCategoryImageCell.h │ │ ├── JXCategoryImageCell.m │ │ ├── JXCategoryImageCellModel.h │ │ ├── JXCategoryImageCellModel.m │ │ ├── JXCategoryImageView.h │ │ └── JXCategoryImageView.m │ │ ├── Indicator │ │ ├── IndicatorViews │ │ │ ├── JXCategoryIndicatorBackgroundView.h │ │ │ ├── JXCategoryIndicatorBackgroundView.m │ │ │ ├── JXCategoryIndicatorBallView.h │ │ │ ├── JXCategoryIndicatorBallView.m │ │ │ ├── JXCategoryIndicatorComponentView.h │ │ │ ├── JXCategoryIndicatorComponentView.m │ │ │ ├── JXCategoryIndicatorDotLineView.h │ │ │ ├── JXCategoryIndicatorDotLineView.m │ │ │ ├── JXCategoryIndicatorImageView.h │ │ │ ├── JXCategoryIndicatorImageView.m │ │ │ ├── JXCategoryIndicatorLineView.h │ │ │ ├── JXCategoryIndicatorLineView.m │ │ │ ├── JXCategoryIndicatorRainbowLineView.h │ │ │ ├── JXCategoryIndicatorRainbowLineView.m │ │ │ ├── JXCategoryIndicatorTriangleView.h │ │ │ └── JXCategoryIndicatorTriangleView.m │ │ ├── JXCategoryIndicatorCell.h │ │ ├── JXCategoryIndicatorCell.m │ │ ├── JXCategoryIndicatorCellModel.h │ │ ├── JXCategoryIndicatorCellModel.m │ │ ├── JXCategoryIndicatorView.h │ │ └── JXCategoryIndicatorView.m │ │ ├── JXCategoryView.h │ │ ├── Number │ │ ├── JXCategoryNumberCell.h │ │ ├── JXCategoryNumberCell.m │ │ ├── JXCategoryNumberCellModel.h │ │ ├── JXCategoryNumberCellModel.m │ │ ├── JXCategoryNumberView.h │ │ └── JXCategoryNumberView.m │ │ ├── Title │ │ ├── JXCategoryTitleCell.h │ │ ├── JXCategoryTitleCell.m │ │ ├── JXCategoryTitleCellModel.h │ │ ├── JXCategoryTitleCellModel.m │ │ ├── JXCategoryTitleView.h │ │ └── JXCategoryTitleView.m │ │ ├── TitleImage │ │ ├── JXCategoryTitleImageCell.h │ │ ├── JXCategoryTitleImageCell.m │ │ ├── JXCategoryTitleImageCellModel.h │ │ ├── JXCategoryTitleImageCellModel.m │ │ ├── JXCategoryTitleImageView.h │ │ └── JXCategoryTitleImageView.m │ │ └── VerticalZoomTitle │ │ ├── JXCategoryTitleVerticalZoomCell.h │ │ ├── JXCategoryTitleVerticalZoomCell.m │ │ ├── JXCategoryTitleVerticalZoomCellModel.h │ │ ├── JXCategoryTitleVerticalZoomCellModel.m │ │ ├── JXCategoryTitleVerticalZoomView.h │ │ └── JXCategoryTitleVerticalZoomView.m ├── Masonry │ ├── MASCompositeConstraint.h │ ├── MASCompositeConstraint.m │ ├── MASConstraint+Private.h │ ├── MASConstraint.h │ ├── MASConstraint.m │ ├── MASConstraintMaker.h │ ├── MASConstraintMaker.m │ ├── MASLayoutConstraint.h │ ├── MASLayoutConstraint.m │ ├── MASUtilities.h │ ├── MASViewAttribute.h │ ├── MASViewAttribute.m │ ├── MASViewConstraint.h │ ├── MASViewConstraint.m │ ├── Masonry.h │ ├── NSArray+MASAdditions.h │ ├── NSArray+MASAdditions.m │ ├── NSArray+MASShorthandAdditions.h │ ├── NSLayoutConstraint+MASDebugAdditions.h │ ├── NSLayoutConstraint+MASDebugAdditions.m │ ├── View+MASAdditions.h │ ├── View+MASAdditions.m │ ├── View+MASShorthandAdditions.h │ ├── ViewController+MASAdditions.h │ └── ViewController+MASAdditions.m └── WaterFallLayout │ ├── TABAnimatedWaterFallLayout.h │ └── TABAnimatedWaterFallLayout.m ├── Util ├── JJTestTableView.h └── JJTestTableView.m └── ViewController ├── CollectionView ├── DelegateSelf │ └── Controller │ │ ├── DelegateSelfCollectionViewController.h │ │ └── DelegateSelfCollectionViewController.m ├── Douban │ └── Controller │ │ ├── DoubanCardViewController.h │ │ ├── DoubanCardViewController.m │ │ ├── DoubanCollectionViewController.h │ │ └── DoubanCollectionViewController.m ├── UseXib │ ├── Controller │ │ ├── XibCollectionViewController.h │ │ └── XibCollectionViewController.m │ └── View │ │ ├── XibCollectionViewCell.h │ │ ├── XibCollectionViewCell.m │ │ └── XibCollectionViewCell.xib └── UserCode │ ├── Controller │ ├── CardViewController.h │ ├── CardViewController.m │ ├── NestCollectionViewController.h │ ├── NestCollectionViewController.m │ ├── SectionsCollectionViewController.h │ ├── SectionsCollectionViewController.m │ ├── SegmentCollectionViewController.h │ ├── SegmentCollectionViewController.m │ ├── TestCollectionViewController.h │ ├── TestCollectionViewController.m │ ├── WaterFlowLayoutViewController.h │ └── WaterFlowLayoutViewController.m │ └── View │ ├── CollectionReuableView │ ├── TestCollectionReusableView.h │ └── TestCollectionReusableView.m │ └── CollectionViewCell │ ├── CardCollectionViewCell.h │ ├── CardCollectionViewCell.m │ ├── CourseCollectionViewCell.h │ ├── CourseCollectionViewCell.m │ ├── DailyCollectionViewCell.h │ ├── DailyCollectionViewCell.m │ ├── ImageCollectionViewCell.h │ ├── ImageCollectionViewCell.m │ ├── LawyerArticleCollectionViewCell.h │ ├── LawyerArticleCollectionViewCell.m │ ├── LawyerCollectionViewCell.h │ ├── LawyerCollectionViewCell.m │ ├── NestCollectionViewCell.h │ ├── NestCollectionViewCell.m │ ├── NewsCollectionViewCell.h │ ├── NewsCollectionViewCell.m │ ├── TestCollectionViewCell.h │ ├── TestCollectionViewCell.m │ ├── WaterFlowCollectionViewCell.h │ └── WaterFlowCollectionViewCell.m ├── CustomView ├── Controller │ ├── DoubanNormalViewController.h │ ├── DoubanNormalViewController.m │ ├── GradientButtonViewController.h │ ├── GradientButtonViewController.m │ ├── PenerateViewExampleController.h │ ├── PenerateViewExampleController.m │ ├── ViewExampleViewController.h │ └── ViewExampleViewController.m └── View │ ├── TestHeadView.h │ └── TestHeadView.m ├── Interface ├── TABAnimatedControllerUIImpl.h ├── TABAnimatedControllerUIImpl.m └── TABAnimatedControllerUIInterface.h ├── Options ├── Base │ ├── BaseOptionViewController.h │ └── BaseOptionViewController.m ├── MainViewController.h ├── MainViewController.m ├── SencondaryOptionViewController.h └── SencondaryOptionViewController.m └── TableView ├── Controller ├── Dynamic Section │ ├── TableDynamicSectionViewController.h │ ├── TableDynamicSectionViewController.m │ ├── TableDynamicWithHeaderViewController.h │ └── TableDynamicWithHeaderViewController.m ├── OneSection │ ├── OneSectionViewController.h │ ├── OneSectionViewController.m │ ├── OneSectionWithHeaderSectionViewController.h │ ├── OneSectionWithHeaderSectionViewController.m │ ├── OneSectionWithTableHeaderViewController.h │ └── OneSectionWithTableHeaderViewController.m ├── Others │ ├── NestTableViewController.h │ ├── NestTableViewController.m │ ├── PullLoadingTableViewController.h │ ├── PullLoadingTableViewController.m │ ├── TableCardViewController.h │ ├── TableCardViewController.m │ ├── TestLayoutDelegateTableViewController.h │ ├── TestLayoutDelegateTableViewController.m │ ├── TestLayoutTableViewController.h │ ├── TestLayoutTableViewController.m │ ├── XibTestViewController.h │ └── XibTestViewController.m ├── Partial Row │ ├── TableRowModeViewController.h │ └── TableRowModeViewController.m ├── Partial Section │ ├── PartialSectionViewController.h │ ├── PartialSectionViewController.m │ ├── PartialSectionWithHeaderViewController.h │ └── PartialSectionWithHeaderViewController.m └── Sections │ ├── MutiSectionMutiCellTableViewController.h │ ├── MutiSectionMutiCellTableViewController.m │ ├── MutiSectionsMutiCellWithHeaderViewController.h │ └── MutiSectionsMutiCellWithHeaderViewController.m ├── DelegateSelf ├── Controller │ ├── DeleagteSelfTableViewController.h │ └── DeleagteSelfTableViewController.m └── View │ ├── BaseTableViewCell.h │ ├── BaseTableViewCell.m │ ├── DelegateSelfTableViewCell.h │ └── DelegateSelfTableViewCell.m ├── EstimatedHeight └── Controller │ ├── TestLayoutDelegateTableViewController.h │ ├── TestLayoutDelegateTableViewController.m │ ├── TestLayoutTableViewController.h │ └── TestLayoutTableViewController.m ├── UseXib ├── Controller │ ├── XibTestViewController.h │ └── XibTestViewController.m └── View │ ├── XIBTableViewCell.h │ ├── XIBTableViewCell.m │ └── XIBTableViewCell.xib ├── UserCode ├── Controller │ ├── TableDynamicSectionViewController.h │ ├── TableDynamicSectionViewController.m │ ├── TableNormalViewController.h │ ├── TableNormalViewController.m │ ├── TableRowModeViewController.h │ ├── TableRowModeViewController.m │ ├── TableSectionsViewController.h │ └── TableSectionsViewController.m └── View │ ├── TableHeaderFooterView │ ├── TestTableHeaderFooterView.h │ └── TestTableHeaderFooterView.m │ └── TableViewCell │ ├── CardTableViewCell.h │ ├── CardTableViewCell.m │ ├── LabWithLinesViewCell.h │ ├── LabWithLinesViewCell.m │ ├── PackageTableViewCell.h │ ├── PackageTableViewCell.m │ ├── ResetFrameTableViewCell.h │ ├── ResetFrameTableViewCell.m │ ├── TestTableViewCell.h │ └── TestTableViewCell.m └── View ├── Cell ├── BaseTableViewCell.h ├── BaseTableViewCell.m ├── CardTableViewCell.h ├── CardTableViewCell.m ├── DailyTableViewCell.h ├── DailyTableViewCell.m ├── DelegateSelfTableViewCell.h ├── DelegateSelfTableViewCell.m ├── LabWithLinesViewCell.h ├── LabWithLinesViewCell.m ├── LawyerTableViewCell.h ├── LawyerTableViewCell.m ├── NestTableViewCell.h ├── NestTableViewCell.m ├── NewsTableViewCell.h ├── NewsTableViewCell.m ├── PackageTableViewCell.h ├── PackageTableViewCell.m ├── TestTableViewCell.h └── TestTableViewCell.m ├── Header ├── LineTableViewHeaderFooterView.h ├── LineTableViewHeaderFooterView.m ├── TestTableHeaderFooterView.h └── TestTableHeaderFooterView.m └── Xib ├── XIBTableViewCell.h ├── XIBTableViewCell.m └── XIBTableViewCell.xib /.github/ISSUE_TEMPLATE/bug-report-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report template 3 | about: In order to let developers describe their problems more accurately. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### New Issue Checklist 11 | 12 | * [ ] I have read the [Documentation](https://github.com/tigerAndBull/TABAnimated/tree/master/Documents) 13 | * [ ] I have searched for a similar issue in the [project](https://github.com/rs/TABAnimated/issues) and found none 14 | 15 | ### Issue Info 16 | 17 | Info | Value | 18 | -------------------------|-------------------------------------| 19 | Platform Name | e.g. iOS / macOS 20 | Platform Version | e.g. 12.0 / 10.14.0 21 | TABAnimated Version | e.g. 5.0.0 / 4.4.0 22 | Xcode Version | e.g. Xcode 11 / Xcode 10 23 | Repro rate | e.g. all the time (100%) / sometimes x% / only once 24 | Repro with our demo prj | e.g. does it happen with our demo project? 25 | Demo project link | e.g. link to a demo project that highlights the issue 26 | 27 | ### Issue Description and Steps 28 | 29 | Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue. 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | #project.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | *.xccheckout 16 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | *.xcuserstate 21 | *.xcscmblueprint 22 | *.DS_Store 23 | *.xcbkptlist 24 | 25 | # CocoaPods 26 | # 27 | # We recommend against adding the Pods directory to your .gitignore. However 28 | # you should judge for yourself, the pros and cons are mentioned at: 29 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 30 | # 31 | Pods/ 32 | Podfile.lock -------------------------------------------------------------------------------- /Documents/上拉加载功能.md: -------------------------------------------------------------------------------- 1 | ## 上拉加载功能 2 | 3 | ## 前言 4 | 本文说明TABAnimated 2.4.0的上拉加载功能 5 | 6 | ## 基本原理 7 | 在原理上没有什么新意,和普通的上拉加载原理一致,基于KVO监听UIScrollView的contentOffSet和contentInset。 8 | 不过,在展示上不再是传统的loading,而是骨架图。 9 | 并且这个骨架图是基于TABAnimated内部的骨架屏生产流程进行制作的,共享缓存、复用池、配置信息、调整回调。 10 | 11 | ## 效果图 12 | 13 | ![image.png](https://upload-images.jianshu.io/upload_images/5632003-3f0a066cfd86a4b4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 14 | 15 | ## 使用方式 16 | 17 | block形式 18 | 19 | ``` 20 | [_tableView tab_addPullLoadingActionHandler:^{ 21 | // 开发者在此处进行数据请求 22 | // 模拟数据请求 23 | [self performSelector:@selector(loadMoreData) withObject:nil afterDelay:0.5]; 24 | }]; 25 | ``` 26 | block形式绑定class、height 27 | 28 | ``` 29 | [_tableView tab_addPullLoadingClass:TestTableViewCell.class viewHeight:100 actionHandler:^{ 30 | // 开发者在此处进行数据请求 31 | // 模拟数据请求 32 | [self performSelector:@selector(loadMoreData) withObject:nil afterDelay:0.5]; 33 | }]; 34 | ``` 35 | 36 | 消息传递形式 37 | 38 | ``` 39 | - (void)tab_addPullLoadinTarget:(id)target selector:(SEL)selector; 40 | - (void)tab_addPullLoadingClass:(nonnull Class)pullLoadingClass viewHeight:(CGFloat)viewHeight target:(id)target selector:(SEL)selector; 41 | ``` 42 | 43 | 停止刷新 44 | 45 | ``` 46 | - (void)tab_stopPullLoading; 47 | ``` 48 | 49 | 永远停止刷新 50 | 51 | ``` 52 | - (void)tab_stopPullLoadingNoMoreData; 53 | ``` 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Documents/不再hook setDelegate和setDataSource.md: -------------------------------------------------------------------------------- 1 | ## 不再hook setDelegate和setDataSource 2 | 3 | TABAnimated从起初的版本开始,为了对`UITableView `和`UICollectionView `进行弱管理,采取了hook的方式,其中包含UITableView和UICollectionView的`setDelegate`和`setDataSource`方法。 4 | 5 | 后来,发现使用xib/sb创建的UITableView/UICollectionView,在关联代理对象的时候,并不会调用`setDelegate`和`setDataSource`方法。这里笔者认为,这种方式只是将指针地址改变,苹果工程师对xib/sb进行了一定的管理。 6 | 7 | 与此同时,未免部分开发者会在开启动画前`多次设置`了不同源代理,所以这样的技术方案存在一定的`安全隐患`,是不合理的。 8 | 9 | 在最新的版本中,将相关的代理方法的hook时机延迟到了目标视图第一次启动TABAnimated骨架屏的时候。 10 | 11 | ## 适配自适应高度是如何做的? 12 | 13 | **答:**实际上采用的是,为代理对象手动加入`heightForRowAtIndexPath`这一实例方法,让其在动画时,遵循指定高度规则,在动画结束后,遵循自动高度规则。 14 | 15 | #### 在此过程中发现了一个值得关注的问题 16 | 17 | **答:**发现在进行addMethod,交换IMP地址,这些操作后,只有首次加载不走`heightForRowAtIndexPath`方法,也就是在第一次就没办法按照我们说好的规则运行:`在动画时,遵循指定高度规则,在动画结束后,遵循自动高度`。 18 | 19 | **是什么原因造成的?解决方案是什么?** 20 | 21 | 有个关键要素,为什么通过hook setDelegate 的方式,首次加载就可以呢? 22 | 23 | 随后,笔者打印了缓存的方法列表,发现在首次交换方法后,`heightForRowAtIndexPath`也是存在于方法列表中的。 24 | 25 | 而之前hook`setDelegate`方法,在交换了方法后,又对`delegate`重新进行了赋值操作。因此,笔者在此时对UITableView重新赋值delegate,问题得以解决。 26 | 27 | **结论:同xib/sb那个问题一样,xib/sb在切换源代理的时候,并不会走`setDelegate`和`setDataSource`方法。 28 | OC基于方法列表本身有一套缓存机制,在重新赋值delegate后,苹果工程师又对于UITableView/UICollectionView做了相应的调整。** 29 | -------------------------------------------------------------------------------- /Documents/动画元素下标问题.md: -------------------------------------------------------------------------------- 1 | ## 前言 2 | 3 | 本文主要解决下面这一个问题: 4 | 5 | 开发者如何才能准确知道动画元素的下标? 6 | 7 | ``` 8 | _tableView.tabAnimated.adjustBlock = ^(TABComponentManager * _Nonnull manager) { 9 | manager.animation(1).down(3).height(12); 10 | manager.animation(2).height(12).reducedWidth(90); 11 | manager.animation(3).down(-5).height(12).radius(0.).reducedWidth(-20); 12 | }; 13 | ``` 14 | 即 `animation(x)` 其中的x的数值是几? 15 | 16 | ## 如何通过实现原理,思考获得下标的? 17 | 18 | TABAnimated采取递归的方式,取得当前视图单元的子视图集合。 19 | 20 | - 对于纯代码布局,下标的顺序就是addSubView的顺序 21 | - 对于xib布局,下标顺序是关联变量的顺序。 22 | 23 | ## 这样做岂不是很麻烦 24 | 1. 对于xib布局特别坑,如果习惯不是特别好,那么关联的组件顺序开发者自己根本就不知道,只能一个一个尝试。 25 | 2. 对于纯代码布局,如果视图数量稍微多一点,就要打开对应的文件去看,然后按照规则得出顺序。 26 | 27 | ## 解决方案 28 | 29 | 起初,我也意识到了这个问题,但思路一直是如何调整动画元素的顺序,让开发者很容易就能准确判断出顺序,然后对应修改。 30 | 31 | 期间,也有想过根据动画元素的frame,按照从左往右,从上至下动态调整顺序,但是还是觉得有点蠢,所以并没有推出。 32 | 33 | 作者自己在集成中也始终觉得这是一个很难受的点。前几天突然顿悟,自己以前太蠢啦,既然已经知道下标了,为什么不体现出来呢? 34 | 35 | 36 | 如下图所示: 37 | 38 | ![image.png](https://upload-images.jianshu.io/upload_images/5632003-5b1eabe64d3a04ed.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 39 | 40 | 41 | 将版本新增的全局属性`openAnimationTag`属性设置为YES, 42 | 会将所有元素自动添加红色的角标,角标就是动画元素对应的下标。 43 | 如此以来,开发者不需要在纠结哪个元素对应是哪个下标了。 44 | 45 | **例如:** 46 | 47 | 调整红色1号的宽度为20,高度为10,圆角为3 48 | 49 | ``` 50 | view.animation(1).width(20).height(10).radius(3); 51 | ``` 52 | 以前把时间都浪费在红色1号的下标是哪个了,现在无需纠结,一眼看过去,哪个对哪个很清晰。 53 | 想要调整红色1号,那就是view.animation(1),屡试不爽。 54 | 55 | **注意:为了防止开发者粗心,在生产环境下没有及时将属性`openAnimationTag`改回去,同时减少生产环境不必要的判断 56 | ,无论`openAnimationTag `的值为多少,红色角标仅会在debug模式下生成。** 57 | 58 | ## 后记 59 | 对于特别复杂的视图,有的元素可能会堆在一起,目前没有提供很好的做法,建议通过实现原理定位下标。 -------------------------------------------------------------------------------- /Documents/实时预览工具.md: -------------------------------------------------------------------------------- 1 | ## 前言 2 | TABAnimated致力于帮助iOS开发者`自动`生成骨架屏,`自动`一词需要打引号,因为并不能一下子就生成你心中完美的效果。 3 | 4 | 后来,增加了`预处理回调`和`链式语法`,开发者可以通过`预处理回调`,快速修改部分属性,达到你心中理想的效果。 5 | 6 | 但是,这个时候又暴露出一个问题,在对链式语法内容进行微调的时候,每次都要编译才能看到效果,先不论编译速度吧,如果是一个复杂视图,可能你需要调整的就要多一点。 7 | 8 | 一遍又一遍地去修改,编译,查看,那岂不是效率极低?因此,TABAnimated - Reveal 应运而生! 9 | 10 | ## TABAnimated - Reveal 四大功能 11 | > + 输入几个参数,即可预览到效果 12 | > + 一键导入链式语法 13 | > + 一键粘贴修改后的链式语法 14 | > + 缓存工作面板数据 15 | 16 | 有效版本号 > 2.0.1 release 17 | 18 | ## 效果图 19 | 20 | ![效果图](https://upload-images.jianshu.io/upload_images/5632003-597b6060d94f46dd.gif?imageMogr2/auto-orient/strip) 21 | 22 | ## 说明 23 | 这个附加工具库的最终目标,是高度自动化,因为开发周期原因,目前用很简单的UI界面,**主要解决调整复杂视图效率低的问题**,也就是说当前没有读取开发者的环境,只是用了预装的简单的环境。 24 | 25 | #### 安装方式 26 | 因为Reveal库依赖核心骨架库,核心骨架库不依赖Reveal,开发者需要在appDelegate里初始化它 27 | 先`#import "TABAnimatedBall.h"`, 然后初始化一下。 28 | ``` 29 | // 骨架屏core部分不依赖reveal工具 30 | // reveal工具依赖骨架屏core,实时预览效果,无需编译 31 | [[TABAnimatedBall shared] install]; 32 | ``` 33 | 34 | ## 工作流程 35 | 36 | ![说明.png](https://upload-images.jianshu.io/upload_images/5632003-82998d1c687c7a13.png?imageMogr2/auto-orient/strip%7CimageView2/3/w/300) 37 | 38 | - 点击骨架圆圈,开关面板 39 | - 输入工程中存在的class名称(建议粘贴,比较快) 40 | - 输入高度,宽度(宽度这个属性对于UITableView的cell无效) 41 | - 点击`预览效果`按钮即可看到 42 | - 调整完毕,达到你满意的效果后,你就可以点击`拷贝代码`按钮,然后粘贴到你需要的地方 43 | 44 | **注意:** 45 | 46 | - 如果你已经对某个视图做过调整了,想在此基础之上,通过工具调整,只需要先复制代码,然后点击`导入链式语法`按钮,粘贴,完成,接着用工具调整 47 | - 默认会保存最近的面板数据,你可以点击`重置所有参数`清空 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 tigerAndBull 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TABAnimated.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | #库名,和文件名一样 4 | s.name = "TABAnimated" 5 | 6 | #tag方式:填tag名称 7 | #commit方式:填commit的id 8 | s.version = "2.6.6" 9 | #库的简介 10 | s.summary = "TABAnimated是一个ios平台上的网络过渡动画(骨架屏)的封装" 11 | 12 | #库的描述 13 | s.description = <<-DESC 14 | TABAnimated是一个ios平台上的网络过渡动画(骨架屏)的封装,目前仅支持oc 15 | DESC 16 | #库的远程仓库地址 17 | s.homepage = "https://github.com/tigerAndBull/TABAnimated" 18 | 19 | #版权方式 20 | s.license = { :type => "MIT", :file => "LICENSE" } 21 | 22 | #库的作者 23 | s.author = { "tigerAndBull" => "1429299849@qq.com" } 24 | 25 | #依赖于ios平台上的8.0 26 | s.platform = :ios, "8.0" 27 | 28 | #库的地址 29 | s.source = { :git => "https://github.com/tigerAndBull/TABAnimated.git", :tag => "2.6.6" } 30 | 31 | s.source_files = 'TABAnimatedDemo/TABAnimated/**/*.{h,m}' 32 | 33 | end 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Cache/TABAnimatedCacheModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedCacheModel.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/21. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TABAnimatedCacheModel : NSObject 14 | 15 | @property (nonatomic, copy) NSString *fileName; 16 | @property (nonatomic, assign) NSInteger loadCount; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Cache/TABAnimatedCacheModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedCacheModel.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/21. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABAnimatedCacheModel.h" 10 | 11 | @implementation TABAnimatedCacheModel 12 | 13 | - (instancetype)init { 14 | if (self = [super init]) { 15 | _loadCount = 1; 16 | } 17 | return self; 18 | } 19 | 20 | + (BOOL)supportsSecureCoding { 21 | return YES; 22 | } 23 | 24 | - (void)encodeWithCoder:(NSCoder *)aCoder { 25 | [aCoder encodeObject:_fileName forKey:@"fileName"]; 26 | [aCoder encodeInteger:_loadCount forKey:@"loadCount"]; 27 | } 28 | 29 | - (id)initWithCoder:(NSCoder *)aDecoder { 30 | if (self = [super init]) { 31 | self.fileName = [aDecoder decodeObjectForKey:@"fileName"]; 32 | self.loadCount = [aDecoder decodeIntegerForKey:@"loadCount"]; 33 | } 34 | return self; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Cache/TABAnimatedDocumentMethod.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDocumentMethod.h 3 | // 4 | // Created by tigerAndBull on 2019/2/15. 5 | // Copyright © 2019 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface TABAnimatedDocumentMethod : NSObject 13 | 14 | + (void)writeToFileWithData:(id)data filePath:(NSString *)filePath; 15 | 16 | + (id)getCacheData:(NSString *)filePath targetClass:(Class)targetClass; 17 | 18 | + (NSString *)getPathByFilePacketName:(NSString *)filePacketName; 19 | 20 | + (BOOL)createFile:(NSString *)file isDir:(BOOL)isdir; 21 | 22 | + (BOOL)isExistFile:(NSString *)path isDir:(BOOL)isDir; 23 | 24 | + (BOOL)deleteFile:(NSString *)file; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Config/TABAnimatedConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedConfig.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/1/15. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedConfig_h 10 | #define TABAnimatedConfig_h 11 | 12 | #import "UIView+TABAnimatedProduction.h" 13 | #import "UIView+TABControlAnimation.h" 14 | #import "NSArray+TABAnimatedChain.h" 15 | #import "UIView+TABControlModel.h" 16 | 17 | #import "TABViewAnimated.h" 18 | #import "TABTableAnimated.h" 19 | #import "TABCollectionAnimated.h" 20 | 21 | #import "TABAnimatedProduction.h" 22 | 23 | typedef void (^TABConfigBlock)(TABViewAnimated * _Nonnull tabAnimated); 24 | 25 | #define tabAnimatedLog(x) {if([TABAnimated sharedAnimated].openLog) NSLog(x);} 26 | #define tab_kColor(s) [UIColor colorWithRed:(((s&0xFF0000)>>16))/255.0 green:(((s&0xFF00)>>8))/255.0 blue:((s&0xFF))/255.0 alpha:1.] 27 | #define tab_RGB(R,G,B) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:1.] 28 | 29 | #define tab_kBackColor tab_kColor(0xEEEEEE) 30 | #define tab_kDarkBackColor tab_kColor(0x282828) 31 | #define tab_kShimmerBackColor tab_kColor(0xDFDFDF) 32 | 33 | #endif /* TABAnimatedConfig_h */ 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UICollectionView+TABControlAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionView+TABControlAnimation.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/6/6. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+TABControlAnimation.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class TABCollectionAnimated; 15 | 16 | typedef void(^TABCollectionViewConfigBlock)(TABCollectionAnimated * _Nonnull tabAnimated); 17 | 18 | @interface UICollectionView (TABControlAnimation) 19 | 20 | - (void)tab_startAnimationWithConfigBlock:(nullable TABCollectionViewConfigBlock)configBlock 21 | adjustBlock:(nullable TABAdjustBlock)adjustBlock 22 | completion:(nullable void (^)(void))completion; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UICollectionView+TABControlAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionView+TABControlAnimation.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/6/6. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UICollectionView+TABControlAnimation.h" 10 | #import "TABCollectionAnimated.h" 11 | #import "UIView+TABControlModel.h" 12 | #import "UIView+TABControlAnimation.h" 13 | 14 | @implementation UICollectionView (TABControlAnimation) 15 | 16 | - (void)tab_startAnimationWithConfigBlock:(nullable TABCollectionViewConfigBlock)configBlock 17 | adjustBlock:(nullable TABAdjustBlock)adjustBlock 18 | completion:(nullable void (^)(void))completion { 19 | if (!self.tabAnimated) { 20 | TABCollectionAnimated *tabAnimated = TABCollectionAnimated.new; 21 | tabAnimated.adjustBlock = adjustBlock; 22 | self.tabAnimated = tabAnimated; 23 | } 24 | 25 | if (configBlock && !self.tabAnimated.configed) { 26 | configBlock(self.tabAnimated); 27 | self.tabAnimated.configed = YES; 28 | } 29 | 30 | [self tab_startAnimation]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UITableView+TABControlAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+TABControlAnimation.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/5/23. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+TABControlAnimation.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class TABTableAnimated; 15 | 16 | typedef void(^TABTableViewConfigBlock)(TABTableAnimated * _Nonnull tabAnimated); 17 | 18 | @interface UITableView (TABControlAnimation) 19 | 20 | - (void)tab_startAnimationWithConfigBlock:(nullable TABTableViewConfigBlock)configBlock 21 | adjustBlock:(nullable TABAdjustBlock)adjustBlock 22 | completion:(nullable void (^)(void))completion; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UITableView+TABControlAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+TABControlAnimation.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/5/23. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UITableView+TABControlAnimation.h" 10 | #import "TABTableAnimated.h" 11 | #import "UIView+TABControlModel.h" 12 | #import "UIView+TABControlAnimation.h" 13 | 14 | @implementation UITableView (TABControlAnimation) 15 | 16 | - (void)tab_startAnimationWithConfigBlock:(nullable TABTableViewConfigBlock)configBlock 17 | adjustBlock:(nullable TABAdjustBlock)adjustBlock 18 | completion:(nullable void (^)(void))completion { 19 | if (!self.tabAnimated) { 20 | TABTableAnimated *tabAnimated = TABTableAnimated.new; 21 | tabAnimated.adjustBlock = adjustBlock; 22 | self.tabAnimated = tabAnimated; 23 | } 24 | 25 | if (configBlock && !self.tabAnimated.configed) { 26 | configBlock(self.tabAnimated); 27 | self.tabAnimated.configed = YES; 28 | } 29 | 30 | [self tab_startAnimation]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UIView+TABAnimated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TABAnimated.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/4/27. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (TABAnimated) 14 | 15 | @property (nonatomic, copy) NSString *tab_name; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UIView+TABAnimated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TABAnimated.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/4/27. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UIView+TABAnimated.h" 10 | #import 11 | 12 | @implementation UIView (TABAnimated) 13 | 14 | - (NSString *)tab_name { 15 | return objc_getAssociatedObject(self, @selector(tab_name)); 16 | } 17 | 18 | - (void)setTab_name:(NSString *)tab_name { 19 | objc_setAssociatedObject(self, @selector(tab_name), tab_name, OBJC_ASSOCIATION_COPY); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Control/UIView+TABControlModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TABControlModel.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/27. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class TABViewAnimated; 14 | @interface UIView (TABControlModel) 15 | @property (nonatomic, strong) TABViewAnimated * _Nullable tabAnimated; 16 | @end 17 | 18 | @class TABTableAnimated; 19 | @interface UITableView (TABControlModel) 20 | @property (nonatomic, strong) TABTableAnimated * _Nullable tabAnimated; 21 | @end 22 | 23 | @class TABCollectionAnimated; 24 | @interface UICollectionView (TABControlModel) 25 | @property (nonatomic, strong) TABCollectionAnimated * _Nullable tabAnimated; 26 | @end 27 | 28 | @class TABCollectionAnimated; 29 | @interface UICollectionViewLayout (TABAnimated) 30 | @property (nonatomic, strong) TABCollectionAnimated * _Nullable tabAnimated; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Bin/TABBinAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBinAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | 呼吸灯动画 15 | */ 16 | @interface TABBinAnimation : NSObject 17 | 18 | /** 19 | * 呼吸灯动画的时长,默认是1s。 20 | */ 21 | @property (nonatomic, assign) CGFloat animatedDurationBin; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Bin/TABBinAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABBinAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABBinAnimation.h" 10 | 11 | @implementation TABBinAnimation 12 | 13 | - (instancetype)init { 14 | if (self = [super init]) { 15 | _animatedDurationBin = 1.; 16 | } 17 | return self; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Bin/TABBinAnimationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBinAnimationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/20. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedDarkModeImpl.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol TABAnimatedDecorateInterface; 15 | 16 | @interface TABBinAnimationImpl : TABAnimatedDarkModeImpl 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABBaseComponent+TABClassicAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseComponent+TABClassicAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABBaseComponent.h" 11 | #import "TABAnimatedChainDefines.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TABBaseComponent (TABClassicAnimation) 16 | 17 | /** 18 | 赋予动画元素画由长到短的动画 19 | 20 | @return 目标动画元素 21 | */ 22 | - (TABBaseComponentVoidBlock)toLongAnimation; 23 | 24 | /** 25 | 赋予动画元素画由短到长的动画 26 | 27 | @return 目标动画元素 28 | */ 29 | - (TABBaseComponentVoidBlock)toShortAnimation; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABBaseComponent+TABClassicAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseComponent+TABClassicAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABBaseComponent+TABClassicAnimation.h" 10 | #import "TABComponentLayer+TABClassicAnimation.h" 11 | 12 | @implementation TABBaseComponent (TABClassicAnimation) 13 | 14 | #pragma mark - toLongAnimation 15 | 16 | - (TABBaseComponentVoidBlock)toLongAnimation { 17 | return ^TABBaseComponent *(void) { 18 | [self result_toLongAnimation]; 19 | return self; 20 | }; 21 | } 22 | 23 | - (void)preview_toLongAnimation { 24 | [self result_toLongAnimation]; 25 | } 26 | 27 | - (void)result_toLongAnimation { 28 | self.layer.baseAnimationType = TABComponentLayerBaseAnimationToLong; 29 | } 30 | 31 | #pragma mark - toShortAnimation 32 | 33 | - (TABBaseComponentVoidBlock)toShortAnimation { 34 | return ^TABBaseComponent *(void) { 35 | [self result_toShortAnimation]; 36 | return self; 37 | }; 38 | } 39 | 40 | - (void)preview_toShortAnimation { 41 | [self result_toShortAnimation]; 42 | } 43 | 44 | - (void)result_toShortAnimation { 45 | self.layer.baseAnimationType = TABComponentLayerBaseAnimationToShort; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABClassicAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TABClassicAnimation : NSObject 14 | 15 | /** 16 | * 来回时长 17 | */ 18 | @property (nonatomic, assign) CGFloat duration; 19 | 20 | /** 21 | * 变长伸缩比例 22 | */ 23 | @property (nonatomic, assign) CGFloat longToValue; 24 | 25 | /** 26 | * 变短伸缩比例 27 | */ 28 | @property (nonatomic, assign) CGFloat shortToValue; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABClassicAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABClassicAnimation.h" 10 | 11 | @implementation TABClassicAnimation 12 | 13 | - (instancetype)init { 14 | if (self = [super init]) { 15 | _duration = 0.7; 16 | _longToValue = 1.9; 17 | _shortToValue = 0.6; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABClassicAnimationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABClassicAnimationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | @protocol TABAnimatedDecorateInterface; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABClassicAnimationImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABComponentLayer+TABClassicAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayer+TABClassicAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABComponentLayer.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef NS_ENUM(NSUInteger, TABComponentLayerBaseAnimationType) { 15 | TABComponentLayerBaseAnimationNone, 16 | TABComponentLayerBaseAnimationToLong, 17 | TABComponentLayerBaseAnimationToShort, 18 | }; 19 | 20 | @interface TABComponentLayer (TABClassicAnimation) 21 | 22 | @property (nonatomic, assign) TABComponentLayerBaseAnimationType baseAnimationType; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABComponentLayer+TABClassicAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayer+TABClassicAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABComponentLayer+TABClassicAnimation.h" 10 | #import 11 | 12 | @implementation TABComponentLayer (TABClassicAnimation) 13 | 14 | - (void)setBaseAnimationType:(TABComponentLayerBaseAnimationType)baseAnimationType { 15 | objc_setAssociatedObject(self, @selector(baseAnimationType), @(baseAnimationType), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 16 | } 17 | 18 | - (TABComponentLayerBaseAnimationType)baseAnimationType { 19 | return [objc_getAssociatedObject(self, _cmd) intValue]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABComponentLayerClassicSerializationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayerClassicSerializationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol TABComponentLayerSerializationInterface; 14 | 15 | @interface TABComponentLayerClassicSerializationImpl : NSObject 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Classic/TABComponentLayerClassicSerializationImpl.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayerClassicSerializationImpl.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABComponentLayerClassicSerializationImpl.h" 10 | #import "TABComponentLayer+TABClassicAnimation.h" 11 | #import "TABComponentLayerSerializationInterface.h" 12 | 13 | @implementation TABComponentLayerClassicSerializationImpl 14 | 15 | - (void)propertyBindWithNewLayer:(TABComponentLayer *)newLayer oldLayer:(TABComponentLayer *)oldLayer { 16 | newLayer.baseAnimationType = oldLayer.baseAnimationType; 17 | } 18 | 19 | - (void)tab_encodeWithCoder:(NSCoder *)aCoder layer:(TABComponentLayer *)layer { 20 | [aCoder encodeInteger:layer.baseAnimationType forKey:@"baseAnimationType"]; 21 | } 22 | 23 | - (id)tab_initWithCoder:(NSCoder *)aDecoder layer:(TABComponentLayer *)layer { 24 | layer.baseAnimationType = [aDecoder decodeIntegerForKey:@"baseAnimationType"]; 25 | return layer; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/NSArray+TABDropAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+DropAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/14. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "TABAnimatedChainDefines.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSArray (TABDropAnimation) 16 | 17 | /** 18 | * 豆瓣动画变色下标,一起变色的元素,设置同一个下标即可。 19 | * 20 | * @return 目标动画元素数组 21 | */ 22 | - (TABAnimatedArrayIntBlock)dropIndex; 23 | 24 | /** 25 | * 适用于多行的动画元素, 26 | * 比如设置 dropFromIndex(3), 那么多行动画组中的第一个动画的下标是3,第二个就是4,依次类推。 27 | * 28 | * @return 目标动画元素数组 29 | */ 30 | - (TABAnimatedArrayIntBlock)dropFromIndex; 31 | 32 | /** 33 | * 将动画层移出豆瓣动画队列,不参与变色。 34 | * 35 | * @return 目标动画元素数组 36 | */ 37 | - (TABAnimatedArrayBlock)removeOnDrop; 38 | 39 | /** 40 | * 豆瓣动画变色停留时间比,默认是0.2。 41 | * 42 | * @return 目标动画元素数组 43 | */ 44 | - (TABAnimatedArrayFloatBlock)dropStayTime; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABBaseComponent+TABDropAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseComponent+TABDropAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/19. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABBaseComponent.h" 11 | #import "TABAnimatedChainDefines.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TABBaseComponent (TABDropAnimation) 16 | 17 | /** 18 | * 豆瓣动画变色下标,一起变色的元素,设置同一个下标即可。 19 | * 20 | * @return 目标动画元素数组 21 | */ 22 | - (TABBaseComponentIntegerBlock)dropIndex; 23 | 24 | /** 25 | * 适用于多行的动画元素, 26 | * 比如设置 dropFromIndex(3), 那么多行动画组中的第一个动画的下标是3,第二个就是4,依次类推。 27 | * 28 | * @return 目标动画元素数组 29 | */ 30 | - (TABBaseComponentIntegerBlock)dropFromIndex; 31 | 32 | /** 33 | * 将动画层移出豆瓣动画队列,不参与变色。 34 | * 35 | * @return 目标动画元素数组 36 | */ 37 | - (TABBaseComponentVoidBlock)removeOnDrop; 38 | 39 | /** 40 | * 豆瓣动画变色停留时间比,默认是0.2。 41 | * 42 | * @return 目标动画元素数组 43 | */ 44 | - (TABBaseComponentFloatBlock)dropStayTime; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABComponentLayer+TABDropAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayer+TABDropLayer.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/19. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABComponentLayer.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABComponentLayer (TABDropAnimation) 15 | 16 | /** 17 | * 该动画元素在豆瓣动画队列中的下标 18 | */ 19 | @property (nonatomic, assign) NSInteger dropAnimationIndex; 20 | 21 | /** 22 | * 对于多行的动画元素,在豆瓣动画队列中,设置它的起点下标 23 | */ 24 | @property (nonatomic, assign) NSInteger dropAnimationFromIndex; 25 | 26 | /** 27 | * 豆瓣动画间隔时间,默认0.2。 28 | */ 29 | @property (nonatomic, assign) CGFloat dropAnimationStayTime; 30 | 31 | /** 32 | * 是否将该元素从豆瓣动画队列中移除 33 | */ 34 | @property (nonatomic, assign) BOOL removeOnDropAnimation; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABComponentLayerDropSerializationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayerDropSerializationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol TABComponentLayerSerializationInterface; 14 | 15 | @interface TABComponentLayerDropSerializationImpl : NSObject 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABDropAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABDropAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | 下坠动画全局属性 15 | */ 16 | @interface TABDropAnimation : NSObject 17 | 18 | /** 19 | * 豆瓣动画帧时长,默认值为0.4,你可以理解为`变色速度`。 20 | */ 21 | @property (nonatomic, assign) CGFloat dropAnimationDuration; 22 | 23 | /** 24 | * 豆瓣动画变色值,默认值为0xE1E1E1 25 | */ 26 | @property (nonatomic, strong) UIColor *dropAnimationDeepColor; 27 | 28 | /** 29 | * 暗黑模式下豆瓣动画变色值 30 | */ 31 | @property (nonatomic, strong) UIColor *dropAnimationDeepColorInDarkMode; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABDropAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABDropAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABDropAnimation.h" 10 | #import "TABAnimatedConfig.h" 11 | 12 | @implementation TABDropAnimation 13 | 14 | - (instancetype)init { 15 | if (self = [super init]) { 16 | _dropAnimationDeepColor = tab_kColor(0xE1E1E1); 17 | _dropAnimationDeepColorInDarkMode = tab_kColor(0x323232); 18 | _dropAnimationDuration = 0.4; 19 | } 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABDropAnimationDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABDropAnimationDefines.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/20. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABDropAnimationDefines_h 10 | #define TABDropAnimationDefines_h 11 | 12 | #import "TABBaseComponent+TABDropAnimation.h" 13 | #import "NSArray+TABDropAnimation.h" 14 | #import "TABDropAnimation.h" 15 | #import "TABDropAnimationImpl.h" 16 | 17 | #endif /* TABDropAnimationDefines_h */ 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Drop/TABDropAnimationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABDropAnimationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/20. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class TABDropAnimation; 14 | @protocol TABAnimatedDecorateInterface, TABAnimatedDarkModeInterface; 15 | 16 | @interface TABDropAnimationImpl : NSObject 17 | 18 | @property (nonatomic, strong) TABDropAnimation *dropAnimation; 19 | 20 | + (instancetype)dropWithAnimation:(TABDropAnimation *)dropAnimation; 21 | - (instancetype)initWithAnimation:(TABDropAnimation *)dropAnimation; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Include/TABAnimatedDecorateInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDecorateInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/6. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedDecorateInterface_h 10 | #define TABAnimatedDecorateInterface_h 11 | 12 | @class TABAnimatedProduction, TABComponentLayer; 13 | 14 | @protocol TABAnimatedDecorateInterface 15 | 16 | @optional 17 | 18 | // layer装饰期 19 | - (void)addAnimationWithTraitCollection:(UITraitCollection *)traitCollection 20 | backgroundLayer:(TABComponentLayer *)backgroundLayer 21 | layers:(NSArray *)layers; 22 | 23 | // 骨架结束,释放 24 | - (void)destory; 25 | 26 | @end 27 | 28 | #endif /* TABAnimatedDecorateInterface_h */ 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Include/TABAnimationManagerInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimationManagerInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/17. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimationManagerInterface_h 10 | #define TABAnimationManagerInterface_h 11 | 12 | @class UIView; 13 | 14 | @protocol TABAnimationManagerInterface 15 | 16 | // 绑定控制视图 17 | - (void)setControlView:(UIView *)controlView; 18 | 19 | // 为目标view添加动画 20 | - (void)addAnimationWithTargetView:(UIView *)targetView; 21 | 22 | - (void)destory; 23 | 24 | @end 25 | 26 | #endif /* TABAnimationManagerInterface_h */ 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Shimmer/TABShimmerAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABShimmerAnimation.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedConfig.h" 11 | #import "TABShimmerAnimationDefines.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TABShimmerAnimation : NSObject 16 | 17 | /** 18 | * 闪光灯动画的时长,默认是1s。 19 | */ 20 | @property (nonatomic, assign) CGFloat shimmerDuration; 21 | 22 | /** 23 | * 闪光灯动画的方向 24 | */ 25 | @property (nonatomic, assign) TABShimmerDirection shimmerDirection; 26 | 27 | /** 28 | * 闪光灯变色值,默认值0xDFDFDF 29 | */ 30 | @property (nonatomic, strong) UIColor *shimmerBackColor; 31 | 32 | /** 33 | * 闪光灯亮度,默认值0.92 34 | */ 35 | @property (nonatomic, assign) CGFloat shimmerBrightness; 36 | 37 | /** 38 | * 暗黑模式下,全局闪光灯背景色 39 | */ 40 | @property (nonatomic, strong) UIColor *shimmerBackColorInDarkMode; 41 | 42 | /** 43 | * 暗黑模式下,全局闪光灯颜色亮度 44 | */ 45 | @property (nonatomic, assign) CGFloat shimmerBrightnessInDarkMode; 46 | 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Shimmer/TABShimmerAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABShimmerAnimation.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/3/12. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABShimmerAnimation.h" 10 | 11 | @implementation TABShimmerAnimation 12 | 13 | - (instancetype)init { 14 | if (self = [super init]) { 15 | _shimmerBackColor = tab_kShimmerBackColor; 16 | _shimmerBackColorInDarkMode = tab_kDarkBackColor; 17 | 18 | _shimmerBrightness = 0.92; 19 | _shimmerBrightnessInDarkMode = 0.5; 20 | 21 | _shimmerDuration = 1.0; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Shimmer/TABShimmerAnimationDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABShimmerAnimationDefines.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/21. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABShimmerAnimationDefines_h 10 | #define TABShimmerAnimationDefines_h 11 | 12 | /** 13 | 闪光灯动画全局属性 14 | */ 15 | 16 | // 闪光灯方向 17 | typedef NS_ENUM(NSUInteger, TABShimmerDirection) { 18 | // 从左往右 19 | TABShimmerDirectionToRight = 0, 20 | // 从右往左 21 | TABShimmerDirectionToLeft, 22 | }; 23 | 24 | // 闪光灯起始位置 25 | typedef NS_ENUM(NSUInteger, TABShimmerProperty) { 26 | // 起 27 | TABShimmerPropertyStartPoint = 0, 28 | // 始 29 | TABShimmerPropertyEndPoint, 30 | }; 31 | 32 | typedef struct { 33 | CGPoint startValue; 34 | CGPoint endValue; 35 | } TABShimmerTransition; 36 | 37 | #endif /* TABShimmerAnimationDefines_h */ 38 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/Shimmer/TABShimmerAnimationImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABShimmerAnimationImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/20. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol TABAnimatedDecorateInterface, TABAnimatedDarkModeInterface; 14 | 15 | @interface TABShimmerAnimationImpl : NSObject 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Animation/TABAnimationManagerImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimationManagerImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/17. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimationManagerInterface.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABAnimationManagerImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Chain/Include/TABAnimatedChainManagerInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedChainManagerInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/17. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedChainManagerInterface_h 10 | #define TABAnimatedChainManagerInterface_h 11 | 12 | #import "TABAnimatedChainDefines.h" 13 | 14 | @class TABComponentLayer, TABAnimatedProduction; 15 | 16 | @protocol TABAnimatedChainManagerInterface 17 | 18 | - (void)chainAdjustWithBackgroundLayer:(TABComponentLayer *)backgroundLayer 19 | layers:(NSMutableArray *)layers 20 | adjustBlock:(TABAdjustBlock)adjustBlock 21 | animatedColor:(UIColor *)animatedColor; 22 | 23 | - (void)chainAdjustWithBackgroundLayer:(TABComponentLayer *)backgroundLayer 24 | layers:(NSMutableArray *)layers 25 | adjustWithClassBlock:(TABAdjustWithClassBlock)adjustWithClassBlock 26 | targetClass:(Class)targetClass 27 | animatedColor:(UIColor *)animatedColor; 28 | 29 | - (void)destory; 30 | 31 | @end 32 | 33 | #endif /* TABAnimatedChainManagerInterface_h */ 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Chain/TABAnimatedChainManagerImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedChainManagerImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/17. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedChainManagerInterface.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABAnimatedChainManagerImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentMutableKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentMutiableKey.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/6/4. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TABComponentMutableKey : NSObject 14 | 15 | @property (nonatomic, assign) NSInteger arrayIndex; 16 | @property (nonatomic, copy) NSString *propertyName; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/Chain/TABComponentMutableKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentMutiableKey.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by wenhuan on 2021/6/4. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABComponentMutableKey.h" 10 | 11 | @implementation TABComponentMutableKey 12 | 13 | - (BOOL)isEqual:(id)object { 14 | 15 | if (self == object) { 16 | return YES; 17 | } 18 | 19 | if (![object isKindOfClass:[TABComponentMutableKey class]]) { 20 | return NO; 21 | } 22 | 23 | TABComponentMutableKey *newKeyObject = object; 24 | if (self.arrayIndex == newKeyObject.arrayIndex 25 | && [self.propertyName isEqualToString:newKeyObject.propertyName]) { 26 | return YES; 27 | } 28 | 29 | return NO; 30 | } 31 | 32 | - (NSUInteger)hash { 33 | return self.arrayIndex ^ [self.propertyName hash]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/Include/TABAnimatedDarkModeDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDarkModeDefines.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/6/30. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedDarkModeDefines_h 10 | #define TABAnimatedDarkModeDefines_h 11 | 12 | typedef enum : NSUInteger { 13 | // 跟随系统 14 | TABAnimatedDarkModeBySystem, 15 | // 强制普通模式 16 | TABAnimatedDarkModeForceNormal, 17 | // 强制暗黑模式 18 | TABAnimatedDarkModeForceDark, 19 | } TABAnimatedDarkModeType; 20 | 21 | #endif /* TABAnimatedDarkModeDefines_h */ 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/Include/TABAnimatedDarkModeInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDarkModeInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/5. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedDarkModeInterface_h 10 | #define TABAnimatedDarkModeInterface_h 11 | 12 | @class TABViewAnimated, TABComponentLayer; 13 | 14 | @protocol TABAnimatedDarkModeInterface 15 | 16 | /// 暗黑模式转化协议主体,开发者可重写 17 | /// TABAnimatedDarkModeImpl是该协议默认的实现,根据traitCollection、tabAnimated自动转化backgroundLayer、layers的属性 18 | /// @param traitCollection 当前的traitCollection 19 | /// @param tabAnimated 目标tabAnimated 20 | /// @param backgroundLayer 目标背景layer 21 | /// @param layers 目标layers 22 | - (void)traitCollectionDidChange:(UITraitCollection *)traitCollection 23 | tabAnimated:(TABViewAnimated *)tabAnimated 24 | backgroundLayer:(TABComponentLayer *)backgroundLayer 25 | layers:(NSArray *)layers; 26 | 27 | @end 28 | 29 | #endif /* TABAnimatedDarkModeInterface_h */ 30 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/Include/TABAnimatedDarkModeManagerInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDarkModeManagerInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/7. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedDarkModeManagerInterface_h 10 | #define TABAnimatedDarkModeManagerInterface_h 11 | 12 | @class UIView; 13 | 14 | @protocol TABAnimatedDarkModeManagerInterface 15 | 16 | // 绑定controlView 17 | - (void)setControlView:(UIView *)controlView; 18 | 19 | // 添加哨兵视图 20 | - (void)addDarkModelSentryView; 21 | 22 | /// 添加需要实时改变的view 23 | - (void)addNeedChangeView:(UIView *)view; 24 | 25 | // 释放 26 | - (void)destroy; 27 | 28 | @end 29 | 30 | #endif /* TABAnimatedDarkModeManagerInterface_h */ 31 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/TABAnimatedDarkModeImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDarkModeSwitchImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/5. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol TABAnimatedDarkModeInterface; 14 | 15 | @interface TABAnimatedDarkModeImpl : NSObject 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/TABAnimatedDarkModeManagerImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDarkModelImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/7. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedDarkModeManagerInterface.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABAnimatedDarkModeManagerImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/TABSentryView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABSentryView.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/29. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef void(^TABSentryViewCallBack)(void); 14 | 15 | @interface TABSentryView : UIView 16 | 17 | @property (nonatomic, copy) TABSentryViewCallBack traitCollectionDidChangeBack; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Decorate/DarkMode/TABSentryView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABSentryView.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/29. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABSentryView.h" 10 | 11 | @implementation TABSentryView 12 | 13 | - (instancetype)init { 14 | if (self = [super init]) { 15 | self.layer.name = @"TABSentryViewLayer"; 16 | self.frame = CGRectMake(0, 0, .1, .1); 17 | self.backgroundColor = UIColor.clearColor; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { 23 | [super traitCollectionDidChange:previousTraitCollection]; 24 | 25 | if (self.traitCollectionDidChangeBack) { 26 | self.traitCollectionDidChangeBack(); 27 | } 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Product/Include/TABAnimatedProductInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedProductInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/1. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedProductInterface_h 10 | #define TABAnimatedProductInterface_h 11 | 12 | #import "TABAnimatedProductDefines.h" 13 | 14 | @class UIView; 15 | 16 | @protocol TABAnimatedProductInterface 17 | 18 | // 生产view并生产骨架元素 19 | - (nonnull __kindof UIView *)productWithControlView:(nonnull UIView *)controlView 20 | currentClass:(nonnull Class)currentClass 21 | indexPath:(nullable NSIndexPath *)indexPath 22 | origin:(TABAnimatedProductOrigin)origin; 23 | 24 | // 生产骨架元素 25 | - (void)productWithView:(nonnull UIView *)view 26 | controlView:(nonnull UIView *)controlView 27 | currentClass:(nonnull Class)currentClass 28 | indexPath:(nullable NSIndexPath *)indexPath 29 | origin:(TABAnimatedProductOrigin)origin; 30 | 31 | // 上拉加载更多生产流流 32 | - (void)pullLoadingProductWithView:(nonnull UIView *)view 33 | controlView:(nonnull UIView *)controlView 34 | currentClass:(nonnull Class)currentClass 35 | indexPath:(nullable NSIndexPath *)indexPath 36 | origin:(TABAnimatedProductOrigin)origin; 37 | 38 | - (void)destory; 39 | 40 | @end 41 | 42 | #endif /* TABAnimatedProductInterface_h */ 43 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Product/Include/TABComponentLayerSerializationInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABComponentLayerSerializationInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/24. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABComponentLayerSerializationInterface_h 10 | #define TABComponentLayerSerializationInterface_h 11 | 12 | @class NSCoder, TABComponentLayer; 13 | 14 | @protocol TABComponentLayerSerializationInterface 15 | 16 | - (void)propertyBindWithNewLayer:(TABComponentLayer *)newLayer oldLayer:(TABComponentLayer *)oldLayer; 17 | 18 | - (void)tab_encodeWithCoder:(NSCoder *)aCoder layer:(TABComponentLayer *)layer; 19 | - (id)tab_initWithCoder:(NSCoder *)aDecoder layer:(TABComponentLayer *)layer; 20 | 21 | @end 22 | 23 | #endif /* TABComponentLayerSerializationInterface_h */ 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Product/TABAnimatedProductImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedProductImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/1. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedProductInterface.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABAnimatedProductImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Product/UIView+TABAnimatedProduction.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Animated.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TABAnimatedProduction; 12 | 13 | @interface UIView (TABAnimatedProduction) 14 | 15 | // 骨架屏管理单元持有 16 | @property (nonatomic, strong) TABAnimatedProduction * _Nullable tabAnimatedProduction; 17 | 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Product/UIView+TABAnimatedProduction.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Animated.m 3 | // 4 | // Created by tigerAndBull on 2018/9/14. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "UIView+TABAnimatedProduction.h" 9 | #import 10 | #import "TABAnimatedProduction.h" 11 | 12 | @implementation UIView (TABAnimatedProduction) 13 | 14 | - (TABAnimatedProduction *)tabAnimatedProduction { 15 | return objc_getAssociatedObject(self, @selector(tabAnimatedProduction)); 16 | } 17 | 18 | - (void)setTabAnimatedProduction:(TABAnimatedProduction *)tabAnimatedProduction { 19 | objc_setAssociatedObject(self, @selector(tabAnimatedProduction), tabAnimatedProduction, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 20 | } 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/PullLoading/UIScrollView+TABAnimated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+TABAnimated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/6/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIScrollView (TABAnimated) 14 | 15 | // 停止刷新 16 | - (void)tab_stopPullLoading; 17 | // 永远停止刷新 18 | - (void)tab_stopPullLoadingNoMoreData; 19 | // 重置下拉刷新状态 20 | - (void)tab_resetPullLoadingState; 21 | 22 | // 添加刷新的回调 23 | - (void)tab_addPullLoadingActionHandler:(void (^)(void))actionHandler; 24 | // 添加刷新的事件 25 | - (void)tab_addPullLoadinTarget:(id)target selector:(SEL)selector; 26 | 27 | // 设置刷新的class、高度、回调 28 | - (void)tab_addPullLoadingClass:(nonnull Class)pullLoadingClass viewHeight:(CGFloat)viewHeight actionHandler:(void (^)(void))actionHandler; 29 | // 设置刷新的class、高度、事件 30 | - (void)tab_addPullLoadingClass:(nonnull Class)pullLoadingClass viewHeight:(CGFloat)viewHeight target:(id)target selector:(SEL)selector; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/PullLoading/UIView+TABExtension.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | NS_ASSUME_NONNULL_BEGIN 6 | 7 | @interface UIView (TABExtension) 8 | 9 | @property (assign, nonatomic) CGFloat tab_x; 10 | @property (assign, nonatomic) CGFloat tab_y; 11 | @property (assign, nonatomic) CGFloat tab_w; 12 | @property (assign, nonatomic) CGFloat tab_h; 13 | @property (assign, nonatomic) CGSize tab_size; 14 | @property (assign, nonatomic) CGPoint tab_origin; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/PullLoading/UIView+TABExtension.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import "UIView+TABExtension.h" 4 | 5 | @implementation UIView (TABExtension) 6 | 7 | - (void)setTab_x:(CGFloat)tab_x { 8 | CGRect frame = self.frame; 9 | frame.origin.x = tab_x; 10 | self.frame = frame; 11 | } 12 | 13 | - (CGFloat)tab_x { 14 | return self.frame.origin.x; 15 | } 16 | 17 | - (void)setTab_y:(CGFloat)tab_y { 18 | CGRect frame = self.frame; 19 | frame.origin.y = tab_y; 20 | self.frame = frame; 21 | } 22 | 23 | - (CGFloat)tab_y { 24 | return self.frame.origin.y; 25 | } 26 | 27 | - (void)setTab_w:(CGFloat)tab_w { 28 | CGRect frame = self.frame; 29 | frame.size.width = tab_w; 30 | self.frame = frame; 31 | } 32 | 33 | - (CGFloat)tab_w { 34 | return self.frame.size.width; 35 | } 36 | 37 | - (void)setTab_h:(CGFloat)tab_h { 38 | CGRect frame = self.frame; 39 | frame.size.height = tab_h; 40 | self.frame = frame; 41 | } 42 | 43 | - (CGFloat)tab_h { 44 | return self.frame.size.height; 45 | } 46 | 47 | - (void)setTab_size:(CGSize)tab_size { 48 | CGRect frame = self.frame; 49 | frame.size = tab_size; 50 | self.frame = frame; 51 | } 52 | 53 | - (CGSize)tab_size { 54 | return self.frame.size; 55 | } 56 | 57 | - (void)setTab_origin:(CGPoint)tab_origin { 58 | CGRect frame = self.frame; 59 | frame.origin = tab_origin; 60 | self.frame = frame; 61 | } 62 | 63 | - (CGPoint)tab_origin { 64 | return self.frame.origin; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/NSArray+TABAnimated.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+TABAnimated.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2021/4/2. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSArray (TABAnimated) 14 | 15 | - (NSArray *)tab_map:(id (^)(id))block; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/NSArray+TABAnimated.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+TABAnimated.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2021/4/2. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "NSArray+TABAnimated.h" 10 | 11 | @implementation NSArray (TABAnimated) 12 | 13 | - (NSArray *)tab_map:(id (^)(id))block { 14 | NSCParameterAssert(block); 15 | NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:self.count]; 16 | for (id value in self) { 17 | id mapedValue = block(value); 18 | if (mapedValue) { 19 | [array addObject:mapedValue]; 20 | } else { 21 | NSAssert(NO, @""); 22 | } 23 | } 24 | return array; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/TABAnimationMethod.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimationMethod.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/12/28. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | FOUNDATION_EXPORT NSString *tab_NSStringFromIndex(NSInteger index); 14 | 15 | @interface TABAnimationMethod : NSObject 16 | 17 | /** 18 | UIView加入淡入淡出动画 19 | @param view 目标view 20 | */ 21 | + (void)addEaseOutAnimation:(UIView *)view; 22 | 23 | /// 获取App版本 24 | + (NSString *)appVersion; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/TABAnimationMethod.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimationMethod.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/12/28. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABAnimationMethod.h" 10 | 11 | @implementation TABAnimationMethod 12 | 13 | NSString *tab_NSStringFromIndex(NSInteger index) { 14 | return [NSString stringWithFormat:@"%ld", index]; 15 | } 16 | 17 | + (void)addEaseOutAnimation:(UIView *)view { 18 | CATransition *animation = [CATransition animation]; 19 | animation.duration = 0.2; 20 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 21 | animation.type = kCATransitionFade; 22 | [view.layer addAnimation:animation forKey:@"animation"]; 23 | } 24 | 25 | + (NSString *)appVersion { 26 | return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/TABWeakDelegateManager.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | NS_ASSUME_NONNULL_BEGIN 5 | 6 | // 非线程安全 7 | @interface TABWeakDelegateManager : NSObject 8 | 9 | - (void)addDelegate:(id)delegate; 10 | - (void)removeDelegate:(id)delegate; 11 | - (void)removeAllDelegates; 12 | 13 | - (void)enumerateDelegatesUsingBlock:(void (^)(id delegate))block; 14 | - (NSArray *)getDelegates; 15 | 16 | @property (readonly) NSUInteger count; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimated/Util/UIScrollView+TABExtension.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | NS_ASSUME_NONNULL_BEGIN 6 | 7 | @interface UIScrollView (TABExtension) 8 | 9 | @property (readonly, nonatomic) UIEdgeInsets tab_inset; 10 | 11 | @property (assign, nonatomic) CGFloat tab_insetT; 12 | @property (assign, nonatomic) CGFloat tab_insetB; 13 | @property (assign, nonatomic) CGFloat tab_insetL; 14 | @property (assign, nonatomic) CGFloat tab_insetR; 15 | 16 | @property (assign, nonatomic) CGFloat tab_offsetX; 17 | @property (assign, nonatomic) CGFloat tab_offsetY; 18 | 19 | @property (assign, nonatomic) CGFloat tab_contentW; 20 | @property (assign, nonatomic) CGFloat tab_contentH; 21 | 22 | - (void)tab_scrollToTop; 23 | - (void)tab_scrollToTopAnimated:(BOOL)animated; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/19. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | @property (strong, nonatomic) UINavigationController *nav; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x-1.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x-2.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Notification@3x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-1.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x-1.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/AppIcon.appiconset/icon.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder-1.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder-2.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/AppConfig/Images.xcassets/placeholder.imageset/placeholder.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/TABAnimatedDemo.pch: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedDemo.pch 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedDemo_pch 10 | #define TABAnimatedDemo_pch 11 | 12 | #import "TABAnimated.h" 13 | #import "BaseDemoViewController.h" 14 | #import "UIColor+TABCategory.h" 15 | #import "TABDefine.h" 16 | #import "Masonry.h" 17 | #import "UIImage+TABAnimatedDemo.h" 18 | 19 | #define kText(x) (NSLocalizedString(x, nil)) 20 | static const NSTimeInterval TABAnimatedDemoDelayTime = 3.; 21 | static const NSTimeInterval TABAnimatedDemoDelayLongTime = 5.; 22 | 23 | #endif /* TABAnimatedDemo_pch */ 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/en-IN.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | TABAnimatedDemo 4 | 5 | Created by tigerAndBull on 2019/5/1. 6 | Copyright © 2019 tigerAndBull. All rights reserved. 7 | */ 8 | //"主页面" = "Show time"; 9 | //"UITableView 示例" = "Example of UITableView"; 10 | //"多行文本 示例" = "Example of numberOflines"; 11 | //"UICollectionView 示例" = "Example of UICollectionView"; 12 | //"UIView 示例" = "Example of UIView"; 13 | //"卡片投影视图 示例" = "Example of the card view"; 14 | //"分段视图 示例" = "Example of the segment view "; 15 | //"cell中使用多级view 示例" = "Example of the multilayer view"; 16 | //"UITableView xib 示例" = "Example of UITableView xib"; 17 | //"嵌套表格 示例" = "Example of the nest view"; 18 | //"UICollectionView 多section 示例" = "Example of UICollectionView with sections"; 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | TABAnimatedDemo 4 | 5 | Created by tigerAndBull on 2019/5/1. 6 | Copyright © 2019 tigerAndBull. All rights reserved. 7 | */ 8 | //"主页面" = "Show time"; 9 | //"UITableView 示例" = "Example of UITableView"; 10 | //"多行文本 示例" = "Example of numberOflines"; 11 | //"UICollectionView 示例" = "Example of UICollectionView"; 12 | //"UIView 示例" = "Example of UIView"; 13 | //"卡片投影视图 示例" = "Example of the card view"; 14 | //"分段视图 示例" = "Example of the segment view "; 15 | //"cell中使用多级view 示例" = "Example of the multilayer view"; 16 | //"UITableView xib 示例" = "Example of UITableView xib"; 17 | //"嵌套表格 示例" = "Example of the nest view"; 18 | //"UICollectionView 多section 示例" = "Example of UICollectionView with sections"; 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/19. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/AppConfig/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | TABAnimatedDemo 4 | 5 | Created by tigerAndBull on 2019/5/1. 6 | Copyright © 2019 tigerAndBull. All rights reserved. 7 | */ 8 | //"主页面" = "主页面"; 9 | //"UITableView 示例" = "UITableView 示例"; 10 | //"多行文本 示例" = "多行文本 示例"; 11 | //"UICollectionView 示例" = "UICollectionView 示例"; 12 | //"UIView 示例" = "UIView 示例"; 13 | //"卡片投影视图 示例" = "卡片投影视图 示例"; 14 | //"分段视图 示例" = "分段视图 示例"; 15 | //"cell中使用多级view 示例" = "cell中使用多级view 示例"; 16 | //"UITableView xib 示例" = "UITableView xib 示例"; 17 | //"嵌套表格 示例" = "嵌套表格 示例"; 18 | //"UICollectionView 多section 示例" = "UICollectionView 多section 示例"; 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Category/UIColor+TABCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+TABCategory.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIColor (TABCategory) 14 | 15 | + (UIColor *)tab_normalDynamicBackgroundColor; 16 | 17 | + (UIColor *)tab_cardDynamicBackgroundColor; 18 | 19 | + (UIColor *)tab_getColorWithLightColor:(UIColor *)lightColor 20 | darkColor:(UIColor * _Nullable)darkColor; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Category/UIImage+TABAnimatedDemo.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+TABAnimatedDemo.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2021/3/24. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIImage (TABAnimatedDemo) 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Category/UIImage+TABAnimatedDemo.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+TABAnimatedDemo.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2021/3/24. 6 | // Copyright © 2021 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UIImage+TABAnimatedDemo.h" 10 | #import 11 | 12 | @implementation UIImage (TABAnimatedDemo) 13 | 14 | + (void)load { 15 | Method imageNamed = class_getClassMethod(self,@selector(imageNamed:)); 16 | Method looha_ImageNamed =class_getClassMethod(self, @selector(tab_none_imageNamed:)); 17 | method_exchangeImplementations(imageNamed, looha_ImageNamed); 18 | } 19 | 20 | + (instancetype)tab_none_imageNamed:(NSString *)name { 21 | if (name && name.length > 0) { 22 | return [self tab_none_imageNamed:name]; 23 | }else{ 24 | return nil; 25 | } 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Cell/BaseCollectionCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JC_BaseCollectionCell.m 3 | // 4 | // Created by tigerAndBull on 2017/12/15. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface BaseCollectionCell : UICollectionViewCell 11 | 12 | @property (nonatomic, strong) id model; 13 | 14 | + (NSString *)cellIdentifier; 15 | + (void)registerCellInCollectionView:(UICollectionView *)collectionView; 16 | + (NSNumber *)cellSizeByClass; 17 | + (NSValue *)cellSizeValue; 18 | - (void)updateWithModel:(id)model; 19 | + (CGSize)cellSize; 20 | + (instancetype)cellWithIndexPath:(NSIndexPath *)indexPath atCollectionView:(UICollectionView *)collectionView; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Cell/BaseCollectionCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JC_BaseCollectionCell.m 3 | // 4 | // Created by tigerAndBull on 2017/12/15. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "BaseCollectionCell.h" 9 | 10 | @implementation BaseCollectionCell 11 | 12 | + (NSString *)cellIdentifier { 13 | return [NSString stringWithFormat:@"%@", [self class]]; 14 | } 15 | 16 | + (NSNumber *)cellSizeByClass { 17 | return @(YES); 18 | } 19 | 20 | + (NSValue *)cellSizeValue { 21 | return [NSValue valueWithCGSize:[self cellSize]]; 22 | } 23 | 24 | + (void)registerCellInCollectionView:(UICollectionView *)collectionView { 25 | [collectionView registerClass:[self class] forCellWithReuseIdentifier:[self cellIdentifier]]; 26 | } 27 | 28 | + (instancetype)cellWithIndexPath:(NSIndexPath *)indexPath atCollectionView:(UICollectionView *)collectionView { 29 | return [collectionView dequeueReusableCellWithReuseIdentifier:[self cellIdentifier] forIndexPath:indexPath]; 30 | } 31 | 32 | - (instancetype)initWithFrame:(CGRect)frame { 33 | self = [super initWithFrame:frame]; 34 | if (self) { 35 | } 36 | return self; 37 | } 38 | 39 | - (void)updateWithModel:(id)model { 40 | self.model = model; 41 | } 42 | 43 | + (CGSize)cellSize { 44 | return CGSizeMake(1, 1); 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Controller/BaseDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseDemoViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface BaseDemoViewController : UIViewController 14 | 15 | - (void)reloadViewAnimated; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/Game.h: -------------------------------------------------------------------------------- 1 | // 2 | // Game.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/15. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TestBaseModel.h" 11 | 12 | @interface Game : TestBaseModel 13 | 14 | @property (nonatomic,strong) NSString *gameId; 15 | @property (nonatomic,strong) NSString *content; 16 | @property (nonatomic,strong) NSString *title; 17 | @property (nonatomic,strong) NSString *cover; 18 | @property (nonatomic,strong) NSString *author; 19 | 20 | @property (nonatomic) long long openTime; 21 | @property (nonatomic) long long endTime; 22 | @property (nonatomic) long long erollTime; 23 | @property (nonatomic) long long erollEndTime; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/Game.m: -------------------------------------------------------------------------------- 1 | // 2 | // Game.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/15. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import "Game.h" 10 | 11 | @implementation Game 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/News.h: -------------------------------------------------------------------------------- 1 | // 2 | // News.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface News : NSObject 14 | 15 | @property (nonatomic,copy) NSString *imageUrl; 16 | @property (nonatomic,copy) NSString *title; 17 | @property (nonatomic,copy) NSString *address; 18 | @property (nonatomic,copy) NSString *coverImageUrls; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/News.m: -------------------------------------------------------------------------------- 1 | // 2 | // News.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "News.h" 10 | 11 | @implementation News 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/TestBaseModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestBaseModel.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestBaseModel : NSObject 14 | 15 | @property (nonatomic, assign) CGFloat viewHeight; 16 | @property (nonatomic, assign) CGSize viewSize; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Model/TestBaseModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestBaseModel.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TestBaseModel.h" 10 | 11 | @implementation TestBaseModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Util/UILabel+TABCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+TABCategory.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by anwenhu on 2023/2/6. 6 | // Copyright © 2023 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UILabel (TABCategory) 14 | 15 | @property (nonatomic, assign) CGFloat lineSpace; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/Util/UILabel+TABCategory.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+TABCategory.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by anwenhu on 2023/2/6. 6 | // Copyright © 2023 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UILabel+TABCategory.h" 10 | 11 | @implementation UILabel (TABCategory) 12 | 13 | @dynamic lineSpace; 14 | 15 | - (void)setLineSpace:(CGFloat)lineSpace { 16 | NSString *labelText = self.text; 17 | NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:labelText attributes:nil]; 18 | NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; 19 | [paragraphStyle setLineSpacing:lineSpace]; 20 | [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [labelText length])]; 21 | self.attributedText = attributedString; 22 | [self sizeToFit]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/View/TestCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestCollectionView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestCollectionView : UICollectionView 14 | 15 | @property (nonatomic, strong) NSMutableArray *dataArray; 16 | @property (nonatomic, copy) NSString *cellName; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Base/View/TestTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestTableView : UITableView 14 | 15 | @property (nonatomic, strong) NSMutableArray *dataArray; 16 | @property (nonatomic, copy) NSString *cellName; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/comic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/comic.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/head.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/long.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/long.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/placeholder.png -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/test.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/test0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/test0.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/test1.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/test2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/test2.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Sources/test3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABAnimated/f117060e9a127db2ba95444b020df7e33c42a009/TABAnimatedDemo/TABAnimatedDemo/Sources/test3.jpg -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/TABInjectionIIIHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABInjectionIIIHelper.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/7/19. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TABInjectionIIIHelper : NSObject 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/TABInjectionIIIHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABInjectionIIIHelper.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/7/19. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABInjectionIIIHelper.h" 10 | #import 11 | 12 | @implementation TABInjectionIIIHelper 13 | 14 | #if DEBUG 15 | 16 | /** 17 | InjectionIII 热部署会调用的一个方法, 18 | runtime给VC绑定上之后,每次部署完就重新viewDidLoad 19 | */ 20 | void injected(id self, SEL _cmd) { 21 | [self viewDidLoad]; 22 | } 23 | 24 | + (void)load { 25 | __block id observer = 26 | [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { 27 | [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle"] load]; 28 | [[NSNotificationCenter defaultCenter] removeObserver:observer]; 29 | }]; 30 | class_addMethod([UIViewController class], NSSelectorFromString(@"injected"), (IMP)injected, "v@:"); 31 | } 32 | 33 | #endif 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/AlertView/TABPopBgView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABPopBgView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/7. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TABPopBgView : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/AlertView/TABPopBgView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABPopBgView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/9/7. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABPopBgView.h" 10 | 11 | @implementation TABPopBgView 12 | 13 | - (void)drawRect:(CGRect)rect { 14 | CGContextRef context = UIGraphicsGetCurrentContext(); 15 | size_t locationsCount = 2; 16 | CGFloat locations[2] = {0.0f, 1.0f}; 17 | CGFloat colors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f}; 18 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 19 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); 20 | CGColorSpaceRelease(colorSpace); 21 | 22 | CGPoint center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 23 | float radius = MIN(self.bounds.size.width , self.bounds.size.height); 24 | CGContextDrawRadialGradient(context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation); 25 | CGGradientRelease(gradient); 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Gradient/UIButton+Gradient.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | #import "UIImage+Gradient.h" 5 | 6 | @interface UIButton (Gradient) 7 | 8 | /** 9 | * 根据给定的颜色,设置按钮的颜色 10 | * @param btnSize 这里要求手动设置下生成图片的大小,防止coder使用第三方layout,没有设置大小 11 | * @param clrs 渐变颜色的数组 12 | * @param percent 渐变颜色的占比数组 13 | * @param type 渐变色的类型 14 | */ 15 | - (UIButton *)gradientButtonWithSize:(CGSize)btnSize colorArray:(NSArray *)clrs percentageArray:(NSArray *)percent gradientType:(GradientType)type; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Gradient/UIButton+Gradient.m: -------------------------------------------------------------------------------- 1 | 2 | #import "UIButton+Gradient.h" 3 | 4 | @implementation UIButton (Gradient) 5 | 6 | - (UIButton *)gradientButtonWithSize:(CGSize)btnSize colorArray:(NSArray *)clrs percentageArray:(NSArray *)percent gradientType:(GradientType)type { 7 | 8 | UIImage *backImage = [[UIImage alloc]createImageWithSize:btnSize gradientColors:clrs percentage:percent gradientType:type]; 9 | 10 | [self setBackgroundImage:backImage forState:UIControlStateNormal]; 11 | 12 | return self; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Gradient/UIImage+Gradient.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | typedef NS_ENUM(NSInteger, GradientType) { 5 | GradientFromTopToBottom = 1, //从上到下 6 | GradientFromLeftToRight, //从做到右 7 | GradientFromLeftTopToRightBottom, //从上到下 8 | GradientFromLeftBottomToRightTop //从上到下 9 | }; 10 | 11 | @interface UIImage (Gradient) 12 | 13 | /** 14 | * 根据给定的颜色,生成渐变色的图片 15 | * @param imageSize 要生成的图片的大小 16 | * @param colorArr 渐变颜色的数组 17 | * @param percents 渐变颜色的占比数组 18 | * @param gradientType 渐变色的类型 19 | */ 20 | - (UIImage *)createImageWithSize:(CGSize)imageSize gradientColors:(NSArray *)colorArr percentage:(NSArray *)percents gradientType:(GradientType)gradientType; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Base/JXCategoryBaseCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryBaseCell.h 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/15. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryBaseCellModel.h" 11 | #import "JXCategoryViewAnimator.h" 12 | #import "JXCategoryViewDefines.h" 13 | 14 | @interface JXCategoryBaseCell : UICollectionViewCell 15 | 16 | @property (nonatomic, strong, readonly) JXCategoryBaseCellModel *cellModel; 17 | @property (nonatomic, strong, readonly) JXCategoryViewAnimator *animator; 18 | 19 | - (void)initializeViews NS_REQUIRES_SUPER; 20 | 21 | - (void)reloadData:(JXCategoryBaseCellModel *)cellModel NS_REQUIRES_SUPER; 22 | 23 | - (BOOL)checkCanStartSelectedAnimation:(JXCategoryBaseCellModel *)cellModel; 24 | 25 | - (void)addSelectedAnimationBlock:(JXCategoryCellSelectedAnimationBlock)block; 26 | 27 | - (void)startSelectedAnimationIfNeeded:(JXCategoryBaseCellModel *)cellModel; 28 | @end 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Base/JXCategoryBaseCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryBaseCellModel.h 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/15. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "JXCategoryViewDefines.h" 12 | 13 | @interface JXCategoryBaseCellModel : NSObject 14 | 15 | @property (nonatomic, assign) NSUInteger index; 16 | 17 | @property (nonatomic, assign) BOOL selected; 18 | 19 | @property (nonatomic, assign) CGFloat cellWidth; 20 | 21 | @property (nonatomic, assign) CGFloat cellSpacing; 22 | 23 | @property (nonatomic, assign) BOOL cellWidthZoomEnabled; 24 | 25 | @property (nonatomic, assign) CGFloat cellWidthNormalZoomScale; 26 | 27 | @property (nonatomic, assign) CGFloat cellWidthCurrentZoomScale; 28 | 29 | @property (nonatomic, assign) CGFloat cellWidthSelectedZoomScale; 30 | 31 | @property (nonatomic, assign) BOOL selectedAnimationEnabled; 32 | 33 | @property (nonatomic, assign) NSTimeInterval selectedAnimationDuration; 34 | 35 | @property (nonatomic, assign) JXCategoryCellSelectedType selectedType; 36 | 37 | @property (nonatomic, assign, getter=isTransitionAnimating) BOOL transitionAnimating; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Base/JXCategoryBaseCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryBaseCellModel.m 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/15. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryBaseCellModel.h" 10 | 11 | @implementation JXCategoryBaseCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryCollectionView.h 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/21. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryIndicatorProtocol.h" 11 | 12 | @interface JXCategoryCollectionView : UICollectionView 13 | 14 | @property (nonatomic, strong) NSArray *> *indicators; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryCollectionView.m 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/21. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryCollectionView.h" 10 | 11 | @implementation JXCategoryCollectionView 12 | 13 | - (void)setIndicators:(NSArray *> *)indicators { 14 | for (UIView *indicator in _indicators) { 15 | //先移除之前的indicator 16 | [indicator removeFromSuperview]; 17 | } 18 | 19 | _indicators = indicators; 20 | 21 | for (UIView *indicator in indicators) { 22 | [self addSubview:indicator]; 23 | } 24 | } 25 | 26 | - (void)layoutSubviews 27 | { 28 | [super layoutSubviews]; 29 | 30 | for (UIView *view in self.indicators) { 31 | [self sendSubviewToBack:view]; 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryFactory.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface JXCategoryFactory : NSObject 13 | 14 | + (CGFloat)interpolationFrom:(CGFloat)from to:(CGFloat)to percent:(CGFloat)percent; 15 | 16 | + (UIColor *)interpolationColorFrom:(UIColor *)fromColor to:(UIColor *)toColor percent:(CGFloat)percent; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryFactory.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryFactory.h" 10 | #import "UIColor+JXAdd.h" 11 | 12 | @implementation JXCategoryFactory 13 | 14 | + (CGFloat)interpolationFrom:(CGFloat)from to:(CGFloat)to percent:(CGFloat)percent 15 | { 16 | percent = MAX(0, MIN(1, percent)); 17 | return from + (to - from)*percent; 18 | } 19 | 20 | + (UIColor *)interpolationColorFrom:(UIColor *)fromColor to:(UIColor *)toColor percent:(CGFloat)percent 21 | { 22 | CGFloat red = [self interpolationFrom:fromColor.jx_red to:toColor.jx_red percent:percent]; 23 | CGFloat green = [self interpolationFrom:fromColor.jx_green to:toColor.jx_green percent:percent]; 24 | CGFloat blue = [self interpolationFrom:fromColor.jx_blue to:toColor.jx_blue percent:percent]; 25 | CGFloat alpha = [self interpolationFrom:fromColor.jx_alpha to:toColor.jx_alpha percent:percent]; 26 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryIndicatorParamsModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorParamsModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/13. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "JXCategoryViewDefines.h" 12 | /** 13 | 指示器不同情况处理时传递的数据模型,不同情况会对不同的属性赋值,根据不同情况的api说明确认。 14 | 为什么会通过model传递数据,因为指示器处理逻辑以后会扩展不同的使用场景,会新增参数,如果不通过model传递,就会在api新增参数,一旦修改api该的地方就特别多了,而且会影响到之前自定义实现的开发者。 15 | */ 16 | @interface JXCategoryIndicatorParamsModel : NSObject 17 | @property (nonatomic, assign) NSInteger selectedIndex; //当前选中的index 18 | @property (nonatomic, assign) CGRect selectedCellFrame; //当前选中的cellFrame 19 | @property (nonatomic, assign) NSInteger leftIndex; //正在过渡中的两个cell,相对位置在左边的cell的index 20 | @property (nonatomic, assign) CGRect leftCellFrame; //正在过渡中的两个cell,相对位置在左边的cell的frame 21 | @property (nonatomic, assign) NSInteger rightIndex; //正在过渡中的两个cell,相对位置在右边的cell的index 22 | @property (nonatomic, assign) CGRect rightCellFrame; //正在过渡中的两个cell,相对位置在右边的cell的frame 23 | @property (nonatomic, assign) CGFloat percent; //正在过渡中的两个cell,从左到右的百分比 24 | @property (nonatomic, assign) NSInteger lastSelectedIndex; //之前选中的index 25 | @property (nonatomic, assign) JXCategoryCellSelectedType selectedType; //cell被选中类型 26 | @end 27 | 28 | 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryIndicatorParamsModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorParamsModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/13. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorParamsModel.h" 10 | 11 | @implementation JXCategoryIndicatorParamsModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryIndicatorProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorProtocol.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "JXCategoryViewDefines.h" 12 | #import "JXCategoryIndicatorParamsModel.h" 13 | 14 | @protocol JXCategoryIndicatorProtocol 15 | 16 | 17 | /** 18 | categoryView重置状态时调用 19 | 20 | param selectedIndex 当前选中的index 21 | param selectedCellFrame 当前选中的cellFrame 22 | @param model 数据模型 23 | */ 24 | - (void)jx_refreshState:(JXCategoryIndicatorParamsModel *)model; 25 | 26 | /** 27 | contentScrollView在进行手势滑动时,处理指示器跟随手势变化UI逻辑; 28 | 29 | param selectedIndex 当前选中的index 30 | param leftIndex 正在过渡中的两个cell,相对位置在左边的cell的index 31 | param leftCellFrame 正在过渡中的两个cell,相对位置在左边的cell的frame 32 | param rightIndex 正在过渡中的两个cell,相对位置在右边的cell的index 33 | param rightCellFrame 正在过渡中的两个cell,相对位置在右边的cell的frame 34 | param percent 过渡百分比 35 | @param model 数据模型 36 | */ 37 | - (void)jx_contentScrollViewDidScroll:(JXCategoryIndicatorParamsModel *)model; 38 | 39 | /** 40 | 选中了某一个cell 41 | 42 | param lastSelectedIndex 之前选中的index 43 | param selectedIndex 选中的index 44 | param selectedCellFrame 选中的cellFrame 45 | param selectedType cell被选中类型 46 | @param model 数据模型 47 | */ 48 | - (void)jx_selectedCell:(JXCategoryIndicatorParamsModel *)model; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryViewAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryViewAnimator.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/1/24. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | @interface JXCategoryViewAnimator : NSObject 14 | @property (nonatomic, assign) NSTimeInterval duration; 15 | @property (nonatomic, copy) void(^progressCallback)(CGFloat percent); 16 | @property (nonatomic, copy) void(^completeCallback)(void); 17 | 18 | - (void)start; 19 | - (void)stop; 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/JXCategoryViewDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryViewDefines.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | static const CGFloat JXCategoryViewAutomaticDimension = -1; 13 | 14 | typedef void(^JXCategoryCellSelectedAnimationBlock)(CGFloat percent); 15 | 16 | typedef NS_ENUM(NSUInteger, JXCategoryComponentPosition) { 17 | JXCategoryComponentPosition_Bottom, 18 | JXCategoryComponentPosition_Top, 19 | }; 20 | 21 | // cell被选中的类型 22 | typedef NS_ENUM(NSUInteger, JXCategoryCellSelectedType) { 23 | JXCategoryCellSelectedTypeUnknown, //未知,不是选中(cellForRow方法里面、两个cell过渡时) 24 | JXCategoryCellSelectedTypeClick, //点击选中 25 | JXCategoryCellSelectedTypeCode, //调用方法`- (void)selectItemAtIndex:(NSInteger)index`选中 26 | JXCategoryCellSelectedTypeScroll //通过滚动到某个cell选中 27 | }; 28 | 29 | typedef NS_ENUM(NSUInteger, JXCategoryTitleLabelAnchorPointStyle) { 30 | JXCategoryTitleLabelAnchorPointStyleCenter, 31 | JXCategoryTitleLabelAnchorPointStyleTop, 32 | JXCategoryTitleLabelAnchorPointStyleBottom, 33 | }; 34 | 35 | #define JXCategoryViewDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 36 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/UIColor+JXAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+JXAdd.h 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/21. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (JXAdd) 12 | 13 | @property (nonatomic, assign, readonly) CGFloat jx_red; 14 | @property (nonatomic, assign, readonly) CGFloat jx_green; 15 | @property (nonatomic, assign, readonly) CGFloat jx_blue; 16 | @property (nonatomic, assign, readonly) CGFloat jx_alpha; 17 | 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Common/UIColor+JXAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+JXAdd.m 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/21. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "UIColor+JXAdd.h" 10 | 11 | @implementation UIColor (JXAdd) 12 | 13 | - (CGFloat)jx_red { 14 | CGFloat r = 0, g, b, a; 15 | [self getRed:&r green:&g blue:&b alpha:&a]; 16 | return r; 17 | } 18 | 19 | - (CGFloat)jx_green { 20 | CGFloat r, g = 0, b, a; 21 | [self getRed:&r green:&g blue:&b alpha:&a]; 22 | return g; 23 | } 24 | 25 | - (CGFloat)jx_blue { 26 | CGFloat r, g, b = 0, a; 27 | [self getRed:&r green:&g blue:&b alpha:&a]; 28 | return b; 29 | } 30 | 31 | - (CGFloat)jx_alpha { 32 | return CGColorGetAlpha(self.CGColor); 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Dot/JXCategoryDotCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryDotCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | @interface JXCategoryDotCell : JXCategoryTitleCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Dot/JXCategoryDotCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryDotCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | typedef NS_ENUM(NSUInteger, JXCategoryDotRelativePosition) { 12 | JXCategoryDotRelativePosition_TopLeft = 0, 13 | JXCategoryDotRelativePosition_TopRight, 14 | JXCategoryDotRelativePosition_BottomLeft, 15 | JXCategoryDotRelativePosition_BottomRight, 16 | }; 17 | 18 | @interface JXCategoryDotCellModel : JXCategoryTitleCellModel 19 | 20 | @property (nonatomic, assign) BOOL dotHidden; 21 | 22 | @property (nonatomic, assign) JXCategoryDotRelativePosition relativePosition; 23 | 24 | @property (nonatomic, assign) CGSize dotSize; 25 | 26 | @property (nonatomic, assign) CGFloat dotCornerRadius; 27 | 28 | @property (nonatomic, strong) UIColor *dotColor; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Dot/JXCategoryDotCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryDotCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryDotCellModel.h" 10 | 11 | @implementation JXCategoryDotCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Dot/JXCategoryDotView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryDotView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryDotCell.h" 11 | #import "JXCategoryDotCellModel.h" 12 | 13 | @interface JXCategoryDotView : JXCategoryTitleView 14 | 15 | //相对于titleLabel的位置,默认:JXCategoryDotRelativePosition_TopRight 16 | @property (nonatomic, assign) JXCategoryDotRelativePosition relativePosition; 17 | //@[@(布尔值)]数组,控制红点是否显示 18 | @property (nonatomic, strong) NSArray *dotStates; 19 | //红点的尺寸。默认:CGSizeMake(10, 10) 20 | @property (nonatomic, assign) CGSize dotSize; 21 | //红点的圆角值。默认:JXCategoryViewAutomaticDimension(self.dotSize.height/2) 22 | @property (nonatomic, assign) CGFloat dotCornerRadius; 23 | //红点的颜色。默认:[UIColor redColor] 24 | @property (nonatomic, strong) UIColor *dotColor; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Image/JXCategoryImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorCell.h" 10 | 11 | @interface JXCategoryImageCell : JXCategoryIndicatorCell 12 | 13 | @property (nonatomic, strong) UIImageView *imageView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Image/JXCategoryImageCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorCellModel.h" 10 | 11 | @interface JXCategoryImageCellModel : JXCategoryIndicatorCellModel 12 | 13 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); 14 | 15 | @property (nonatomic, copy) NSString *imageName; //加载bundle内的图片 16 | 17 | @property (nonatomic, strong) NSURL *imageURL; //图片URL 18 | 19 | @property (nonatomic, copy) NSString *selectedImageName; 20 | 21 | @property (nonatomic, strong) NSURL *selectedImageURL; 22 | 23 | @property (nonatomic, assign) CGSize imageSize; 24 | 25 | @property (nonatomic, assign) CGFloat imageCornerRadius; 26 | 27 | @property (nonatomic, assign) BOOL imageZoomEnabled; 28 | 29 | @property (nonatomic, assign) CGFloat imageZoomScale; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Image/JXCategoryImageCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryImageCellModel.h" 10 | 11 | @implementation JXCategoryImageCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Image/JXCategoryImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorView.h" 10 | #import "JXCategoryImageCell.h" 11 | #import "JXCategoryImageCellModel.h" 12 | 13 | @interface JXCategoryImageView : JXCategoryIndicatorView 14 | 15 | @property (nonatomic, strong) NSArray *imageNames; 16 | 17 | @property (nonatomic, strong) NSArray *imageURLs; 18 | 19 | @property (nonatomic, strong) NSArray *selectedImageNames; 20 | 21 | @property (nonatomic, strong) NSArray *selectedImageURLs; 22 | 23 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); //使用imageURL从远端下载图片进行加载,建议使用SDWebImage等第三方库进行下载。 24 | 25 | @property (nonatomic, assign) CGSize imageSize; //默认CGSizeMake(20, 20) 26 | 27 | @property (nonatomic, assign) CGFloat imageCornerRadius; //图片圆角 28 | 29 | @property (nonatomic, assign) BOOL imageZoomEnabled; //默认为NO 30 | 31 | @property (nonatomic, assign) CGFloat imageZoomScale; //默认1.2,imageZoomEnabled为YES才生效 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorBackgroundView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorBackgroundView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @interface JXCategoryIndicatorBackgroundView : JXCategoryIndicatorComponentView 12 | 13 | //背景指示器的宽度。默认JXCategoryViewAutomaticDimension(与cellWidth相等) 14 | @property (nonatomic, assign) CGFloat backgroundViewWidth; 15 | //背景指示器的宽度增量补偿,背景指示器一般要比cell宽度大。默认10 16 | @property (nonatomic, assign) CGFloat backgroundViewWidthIncrement; 17 | //背景指示器的高度。默认JXCategoryViewAutomaticDimension(与cell高度相等) 18 | @property (nonatomic, assign) CGFloat backgroundViewHeight; 19 | //背景指示器的圆角值。默认JXCategoryViewAutomaticDimension(即backgroundViewHeight/2) 20 | @property (nonatomic, assign) CGFloat backgroundViewCornerRadius; 21 | //背景指示器的颜色。默认为[UIColor redColor] 22 | @property (nonatomic, strong) UIColor *backgroundViewColor; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorBallView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorBallView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/21. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @interface JXCategoryIndicatorBallView : JXCategoryIndicatorComponentView 12 | 13 | //球的尺寸。默认:CGSizeMake(15, 15) 14 | @property (nonatomic, assign) CGSize ballViewSize; 15 | //球的X轴偏移量。默认:20 16 | @property (nonatomic, assign) CGFloat ballScrollOffsetX; 17 | //球的颜色值。默认为[UIColor redColor] 18 | @property (nonatomic, strong) UIColor *ballViewColor; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponentBaseView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryIndicatorProtocol.h" 11 | #import "JXCategoryViewDefines.h" 12 | 13 | @interface JXCategoryIndicatorComponentView : UIView 14 | 15 | //指示器的位置。底部或者顶部 16 | @property (nonatomic, assign) JXCategoryComponentPosition componentPosition; 17 | //垂直方向偏移。数值越大越靠近中心。默认:0。 18 | @property (nonatomic, assign) CGFloat verticalMargin; 19 | //手势滚动、点击切换的时候,是否允许滚动,默认YES 20 | @property (nonatomic, assign) BOOL scrollEnabled; 21 | //滚动动画的时间。默认0.25 22 | @property (nonatomic, assign) NSTimeInterval scrollAnimationDuration; 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponentBaseView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @implementation JXCategoryIndicatorComponentView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | _componentPosition = JXCategoryComponentPosition_Bottom; 18 | _scrollEnabled = YES; 19 | _verticalMargin = 0; 20 | _scrollAnimationDuration = 0.25; 21 | } 22 | return self; 23 | } 24 | 25 | - (instancetype)initWithCoder:(NSCoder *)coder 26 | { 27 | self = [super initWithCoder:coder]; 28 | if (self) { 29 | NSAssert(NO, @"Use initWithFrame"); 30 | } 31 | return self; 32 | } 33 | 34 | #pragma mark - JXCategoryIndicatorProtocol 35 | 36 | - (void)jx_refreshState:(JXCategoryIndicatorParamsModel *)model { 37 | 38 | } 39 | 40 | - (void)jx_contentScrollViewDidScroll:(JXCategoryIndicatorParamsModel *)model { 41 | 42 | } 43 | 44 | - (void)jx_selectedCell:(JXCategoryIndicatorParamsModel *)model { 45 | 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorDotLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorDotLineView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @interface JXCategoryIndicatorDotLineView : JXCategoryIndicatorComponentView 12 | 13 | //点的尺寸。默认:CGSizeMake(10, 10) 14 | @property (nonatomic, assign) CGSize dotSize; 15 | //线状态的最大宽度。默认:50 16 | @property (nonatomic, assign) CGFloat lineWidth; 17 | //点线的颜色值。默认为[UIColor redColor] 18 | @property (nonatomic, strong) UIColor *dotLineViewColor; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorImageView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @interface JXCategoryIndicatorImageView : JXCategoryIndicatorComponentView 12 | //显示指示器图片的UIImageView 13 | @property (nonatomic, strong, readonly) UIImageView *indicatorImageView; 14 | //图片是否开启滚动。默认NO 15 | @property (nonatomic, assign) BOOL indicatorImageViewRollEnabled; 16 | //图片的尺寸。默认:CGSizeMake(30, 20) 17 | @property (nonatomic, assign) CGSize indicatorImageViewSize; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorRainbowLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorRainbowLineView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/13. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorLineView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | 会无视JXCategoryIndicatorLineView的indicatorLineViewColor属性,以indicatorColors为准 15 | */ 16 | @interface JXCategoryIndicatorRainbowLineView : JXCategoryIndicatorLineView 17 | 18 | //数量需要与cell的数量相等。没有提供默认值,必须要赋值该属性。categoryView在reloadData的时候,也要一并更新该属性,不然会出现数组越界。 19 | @property (nonatomic, strong) NSArray *indicatorColors; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorRainbowLineView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorRainbowLineView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/13. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorRainbowLineView.h" 10 | #import "JXCategoryFactory.h" 11 | 12 | @implementation JXCategoryIndicatorRainbowLineView 13 | 14 | - (void)jx_refreshState:(JXCategoryIndicatorParamsModel *)model { 15 | [super jx_refreshState:model]; 16 | 17 | UIColor *color = self.indicatorColors[model.selectedIndex]; 18 | self.backgroundColor = color; 19 | } 20 | 21 | - (void)jx_contentScrollViewDidScroll:(JXCategoryIndicatorParamsModel *)model { 22 | [super jx_contentScrollViewDidScroll:model]; 23 | 24 | UIColor *leftColor = self.indicatorColors[model.leftIndex]; 25 | UIColor *rightColor = self.indicatorColors[model.rightIndex]; 26 | UIColor *color = [JXCategoryFactory interpolationColorFrom:leftColor to:rightColor percent:model.percent]; 27 | self.backgroundColor = color; 28 | } 29 | 30 | - (void)jx_selectedCell:(JXCategoryIndicatorParamsModel *)model { 31 | [super jx_selectedCell:model]; 32 | 33 | UIColor *color = self.indicatorColors[model.selectedIndex]; 34 | self.backgroundColor = color; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/IndicatorViews/JXCategoryIndicatorTriangleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorTriangleView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/17. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | @interface JXCategoryIndicatorTriangleView : JXCategoryIndicatorComponentView 12 | //三角形的尺寸。默认:CGSizeMake(14, 10) 13 | @property (nonatomic, assign) CGSize triangleViewSize; 14 | //三角形的颜色值。默认:[UIColor redColor] 15 | @property (nonatomic, strong) UIColor *triangleViewColor; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/JXCategoryIndicatorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponetCell.h 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/7/25. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryBaseCell.h" 10 | 11 | @interface JXCategoryIndicatorCell : JXCategoryBaseCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/JXCategoryIndicatorCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponentCellModel.h 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/7/25. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryBaseCellModel.h" 11 | 12 | @interface JXCategoryIndicatorCellModel : JXCategoryBaseCellModel 13 | 14 | @property (nonatomic, assign) BOOL sepratorLineShowEnabled; 15 | 16 | @property (nonatomic, strong) UIColor *separatorLineColor; 17 | 18 | @property (nonatomic, assign) CGSize separatorLineSize; 19 | 20 | @property (nonatomic, assign) CGRect backgroundViewMaskFrame; //底部指示器的frame转换到cell的frame 21 | 22 | @property (nonatomic, assign) BOOL cellBackgroundColorGradientEnabled; 23 | 24 | @property (nonatomic, strong) UIColor *cellBackgroundUnselectedColor; 25 | 26 | @property (nonatomic, strong) UIColor *cellBackgroundSelectedColor; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Indicator/JXCategoryIndicatorCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponentCellModel.m 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/7/25. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorCellModel.h" 10 | 11 | @implementation JXCategoryIndicatorCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/JXCategoryView.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import "JXCategoryBaseView.h" 4 | #import "JXCategoryIndicatorView.h" 5 | #import "JXCategoryTitleView.h" 6 | #import "JXCategoryImageView.h" 7 | #import "JXCategoryTitleImageView.h" 8 | #import "JXCategoryNumberView.h" 9 | #import "JXCategoryDotView.h" 10 | 11 | #import "JXCategoryFactory.h" 12 | #import "JXCategoryIndicatorProtocol.h" 13 | #import "JXCategoryViewDefines.h" 14 | #import "JXCategoryListContainerView.h" 15 | 16 | #import "JXCategoryIndicatorComponentView.h" 17 | #import "JXCategoryIndicatorLineView.h" 18 | #import "JXCategoryIndicatorTriangleView.h" 19 | #import "JXCategoryIndicatorImageView.h" 20 | #import "JXCategoryIndicatorBackgroundView.h" 21 | #import "JXCategoryIndicatorBallView.h" 22 | #import "JXCategoryIndicatorRainbowLineView.h" 23 | 24 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Number/JXCategoryNumberCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryNumberCell.h 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/4/9. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | @interface JXCategoryNumberCell : JXCategoryTitleCell 12 | @property (nonatomic, strong) UILabel *numberLabel; 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Number/JXCategoryNumberCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryNumberCellModel.h 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/4/24. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | @interface JXCategoryNumberCellModel : JXCategoryTitleCellModel 12 | 13 | @property (nonatomic, assign) NSInteger count; 14 | @property (nonatomic, copy) NSString *numberString; 15 | @property (nonatomic, copy) void(^numberStringFormatterBlock)(NSInteger number); 16 | @property (nonatomic, strong) UIColor *numberBackgroundColor; 17 | @property (nonatomic, strong) UIColor *numberTitleColor; 18 | @property (nonatomic, assign) CGFloat numberLabelWidthIncrement; 19 | @property (nonatomic, assign) CGFloat numberLabelHeight; 20 | @property (nonatomic, strong) UIFont *numberLabelFont; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Number/JXCategoryNumberCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryNumberCellModel.m 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/4/24. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryNumberCellModel.h" 10 | 11 | @implementation JXCategoryNumberCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Number/JXCategoryNumberView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryNumberView.h 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/4/9. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryNumberCell.h" 11 | #import "JXCategoryNumberCellModel.h" 12 | 13 | @interface JXCategoryNumberView : JXCategoryTitleView 14 | 15 | /** 16 | 需要与titles的count对应 17 | */ 18 | @property (nonatomic, strong) NSArray *counts; 19 | 20 | /** 21 | 内部默认不会格式化数字,直接转成字符串显示。比如业务需要数字超过999显示999+,可以通过该block实现。 22 | */ 23 | @property (nonatomic, copy) NSString *(^numberStringFormatterBlock)(NSInteger number); 24 | 25 | /** 26 | numberLabel的font,默认:[UIFont systemFontOfSize:11] 27 | */ 28 | @property (nonatomic, strong) UIFont *numberLabelFont; 29 | 30 | /** 31 | 数字的背景色,默认:[UIColor colorWithRed:241/255.0 green:147/255.0 blue:95/255.0 alpha:1] 32 | */ 33 | @property (nonatomic, strong) UIColor *numberBackgroundColor; 34 | 35 | /** 36 | 数字的title颜色,默认:[UIColor whiteColor] 37 | */ 38 | @property (nonatomic, strong) UIColor *numberTitleColor; 39 | 40 | /** 41 | numberLabel的宽度补偿,label真实的宽度是文字内容的宽度加上补偿的宽度,默认:10 42 | */ 43 | @property (nonatomic, assign) CGFloat numberLabelWidthIncrement; 44 | 45 | /** 46 | numberLabel的高度,默认:14 47 | */ 48 | @property (nonatomic, assign) CGFloat numberLabelHeight; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Title/JXCategoryTitleCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleCell.h 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/15. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorCell.h" 10 | #import "JXCategoryViewDefines.h" 11 | @class JXCategoryTitleCellModel; 12 | 13 | @interface JXCategoryTitleCell : JXCategoryIndicatorCell 14 | 15 | @property (nonatomic, strong) UILabel *titleLabel; 16 | 17 | @property (nonatomic, strong) UILabel *maskTitleLabel; 18 | 19 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleZoomAnimationBlock:(JXCategoryTitleCellModel *)cellModel baseScale:(CGFloat)baseScale; 20 | 21 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleStrokeWidthAnimationBlock:(JXCategoryTitleCellModel *)cellModel attributedString:(NSMutableAttributedString *)attributedString; 22 | 23 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleColorAnimationBlock:(JXCategoryTitleCellModel *)cellModel; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/Title/JXCategoryTitleCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleCellModel.m 3 | // UI系列测试 4 | // 5 | // Created by jiaxin on 2018/3/15. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | @implementation JXCategoryTitleCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/TitleImage/JXCategoryTitleImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | @interface JXCategoryTitleImageCell : JXCategoryTitleCell 12 | 13 | @property (nonatomic, strong) UIImageView *imageView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/TitleImage/JXCategoryTitleImageCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleImageCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | typedef NS_ENUM(NSUInteger, JXCategoryTitleImageType) { 12 | JXCategoryTitleImageType_TopImage = 0, 13 | JXCategoryTitleImageType_LeftImage, 14 | JXCategoryTitleImageType_BottomImage, 15 | JXCategoryTitleImageType_RightImage, 16 | JXCategoryTitleImageType_OnlyImage, 17 | JXCategoryTitleImageType_OnlyTitle, 18 | }; 19 | 20 | @interface JXCategoryTitleImageCellModel : JXCategoryTitleCellModel 21 | 22 | @property (nonatomic, assign) JXCategoryTitleImageType imageType; 23 | 24 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); 25 | 26 | @property (nonatomic, copy) NSString *imageName; //加载bundle内的图片 27 | 28 | @property (nonatomic, strong) NSURL *imageURL; //图片URL 29 | 30 | @property (nonatomic, copy) NSString *selectedImageName; 31 | 32 | @property (nonatomic, strong) NSURL *selectedImageURL; 33 | 34 | @property (nonatomic, assign) CGSize imageSize; //默认CGSizeMake(20, 20) 35 | 36 | @property (nonatomic, assign) CGFloat titleImageSpacing; //titleLabel和ImageView的间距,默认5 37 | 38 | @property (nonatomic, assign) BOOL imageZoomEnabled; 39 | 40 | @property (nonatomic, assign) CGFloat imageZoomScale; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/TitleImage/JXCategoryTitleImageCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleImageCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleImageCellModel.h" 10 | 11 | @implementation JXCategoryTitleImageCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/TitleImage/JXCategoryTitleImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryImageView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryTitleImageCell.h" 11 | #import "JXCategoryTitleImageCellModel.h" 12 | 13 | @interface JXCategoryTitleImageView : JXCategoryTitleView 14 | 15 | //普通状态下的imageNames,通过[UIImage imageNamed:]方法加载 16 | @property (nonatomic, strong) NSArray *imageNames; 17 | //选中状态下的imageNames,通过[UIImage imageNamed:]方法加载。可选 18 | @property (nonatomic, strong) NSArray *selectedImageNames; 19 | //普通状态下的imageURLs,通过loadImageCallback回调加载 20 | @property (nonatomic, strong) NSArray *imageURLs; 21 | //选中状态下的selectedImageURLs,通过loadImageCallback回调加载 22 | @property (nonatomic, strong) NSArray *selectedImageURLs; 23 | //默认@[JXCategoryTitleImageType_LeftImage...] 24 | @property (nonatomic, strong) NSArray *imageTypes; 25 | //使用imageURL从远端下载图片进行加载,建议使用SDWebImage等第三方库进行下载。 26 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); 27 | //图片尺寸。默认CGSizeMake(20, 20) 28 | @property (nonatomic, assign) CGSize imageSize; 29 | //titleLabel和ImageView的间距,默认5 30 | @property (nonatomic, assign) CGFloat titleImageSpacing; 31 | //图片是否缩放。默认为NO 32 | @property (nonatomic, assign) BOOL imageZoomEnabled; 33 | //图片缩放的最大scale。默认1.2,imageZoomEnabled为YES才生效 34 | @property (nonatomic, assign) CGFloat imageZoomScale; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleVerticalZoomCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/14. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTitleVerticalZoomCell : JXCategoryTitleCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleVerticalZoomCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/14. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTitleVerticalZoomCellModel : JXCategoryTitleCellModel 14 | 15 | @property (nonatomic, assign) CGFloat maxVerticalFontScale; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/JXCategoryView/Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleVerticalZoomCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/14. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleVerticalZoomCellModel.h" 10 | 11 | @implementation JXCategoryTitleVerticalZoomCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide NS_DEPRECATED_IOS(8.0, 11.0); 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide NS_DEPRECATED_IOS(8.0, 11.0); 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop NS_DEPRECATED_IOS(8.0, 11.0); 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom NS_DEPRECATED_IOS(8.0, 11.0); 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop NS_DEPRECATED_IOS(8.0, 11.0); 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom NS_DEPRECATED_IOS(8.0, 11.0); 26 | 27 | @end 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Third/WaterFallLayout/TABAnimatedWaterFallLayout.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | @class TABAnimatedWaterFallLayout; 5 | 6 | NS_ASSUME_NONNULL_BEGIN 7 | 8 | @protocol TABAnimatedWaterFallLayoutDelegate 9 | 10 | // item 高度 11 | - (CGFloat)waterFallLayout:(TABAnimatedWaterFallLayout *)waterFallLayout heightForItemAtIndex:(NSInteger)index itemWidth:(CGFloat)itemWidth; 12 | 13 | @optional 14 | // 多少列 15 | - (NSUInteger)numberColumnsInWaterFallLayout:(TABAnimatedWaterFallLayout *)waterFallLayout; 16 | // 列间距 17 | - (CGFloat)columnSpacingInWaterFallLayout:(TABAnimatedWaterFallLayout *)waterFallLayout; 18 | // 行间距 19 | - (CGFloat)lineSpacingInWaterFallLayout:(TABAnimatedWaterFallLayout *)waterFallLayout; 20 | // 边距 21 | - (UIEdgeInsets)sectionInsetInWaterFallLayout:(TABAnimatedWaterFallLayout *)waterFallLayout; 22 | 23 | @end 24 | 25 | @interface TABAnimatedWaterFallLayout : UICollectionViewLayout 26 | 27 | @property (nonatomic, weak) id delegate; 28 | 29 | // 总列数 30 | @property (nonatomic, assign) NSInteger columnCount; 31 | // 列间距 32 | @property (nonatomic, assign) NSInteger columnSpacing; 33 | // 行间距 34 | @property (nonatomic, assign) NSInteger lineSpacing; 35 | // 边距 36 | @property (nonatomic, assign) UIEdgeInsets sectionInset; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/Util/JJTestTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JJTestTableView.h 3 | // AnimatedDemo 4 | // 5 | // Created by Joey Chan on 2018/10/24. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JJTestTableView : UITableView 14 | @property (nonatomic , copy) NSArray *dataArray; 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/DelegateSelf/Controller/DelegateSelfCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateSelfCollectionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DelegateSelfCollectionViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/Douban/Controller/DoubanCardViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoubanCardViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/15. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DoubanCardViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/Douban/Controller/DoubanCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoubanCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/15. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DoubanCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UseXib/Controller/XibCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XibCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/22. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface XibCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UseXib/View/XibCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XibCollectionViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/22. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface XibCollectionViewCell : UICollectionViewCell 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *leftLab; 16 | @property (weak, nonatomic) IBOutlet UIButton *rightBtn; 17 | @property (weak, nonatomic) IBOutlet UILabel *bottomLab; 18 | 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UseXib/View/XibCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XibCollectionViewCell.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/22. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "XibCollectionViewCell.h" 10 | 11 | @implementation XibCollectionViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/CardViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateCardViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/4/15. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CardViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/NestCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NestCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/12/31. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NestCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/SectionsCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SectionsCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/1. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SectionsCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/SegmentCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateCategoryCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/4/15. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SegmentCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/TestCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestCollectionViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestCollectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/Controller/WaterFlowLayoutViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaterFlowLayoutViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/12/22. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseDemoViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WaterFlowLayoutViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionReuableView/TestCollectionReusableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestCollectionReusableView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestCollectionReusableView : UICollectionReusableView 14 | 15 | @property (nonatomic, strong) UILabel *titleLab; 16 | @property (nonatomic, strong) UIView *lineView; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionReuableView/TestCollectionReusableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestCollectionReusableView.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TestCollectionReusableView.h" 10 | 11 | @implementation TestCollectionReusableView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | if (self = [super initWithFrame:frame]) { 15 | 16 | UILabel *lab = [[UILabel alloc] init]; 17 | lab.frame = CGRectMake(kWidth(15)+3+4, 10, 100, 50); 18 | lab.font = kBlodFont(18); 19 | lab.textColor = [UIColor blackColor]; 20 | lab.text = @"嵌套嵌套"; 21 | self.titleLab = lab; 22 | [self addSubview:lab]; 23 | 24 | UIView *view = [[UIView alloc] init]; 25 | view.frame = CGRectMake(kWidth(15), 10+8+10, 3, 14); 26 | view.backgroundColor = kColor(0xE74E46FF); 27 | view.layer.cornerRadius = 1.5f; 28 | self.lineView = lab; 29 | [self addSubview:view]; 30 | } 31 | return self; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/CardCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CourseListCollectionViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/3/6. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CardCollectionViewCell : BaseCollectionCell 14 | 15 | @property (nonatomic,strong) UIImageView *leftImg; 16 | @property (nonatomic,strong) UILabel *infoLab; 17 | @property (nonatomic,strong) UILabel *titleLab; 18 | @property (nonatomic,strong) UILabel *contentLab; 19 | @property (nonatomic,strong) UILabel *timeLab; 20 | @property (nonatomic,strong) UILabel *priceLab; 21 | 22 | - (void)updateWithModel:(id)model; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/CourseCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CourseCollectionViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/2/25. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CourseCollectionViewCell : BaseCollectionCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/DailyCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DailyCollectionViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/2/25. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DailyCollectionViewCell : BaseCollectionCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/ImageCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseCollectionCell.h" 3 | 4 | NS_ASSUME_NONNULL_BEGIN 5 | 6 | @interface ImageCollectionViewCell : BaseCollectionCell 7 | 8 | @property (nonatomic, strong) UIImageView *imgV; 9 | 10 | @end 11 | 12 | NS_ASSUME_NONNULL_END 13 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/ImageCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | #import "ImageCollectionViewCell.h" 2 | 3 | #import "TABAnimated.h" 4 | #import "Masonry.h" 5 | #import "TABDefine.h" 6 | 7 | @interface ImageCollectionViewCell() 8 | 9 | @end 10 | 11 | @implementation ImageCollectionViewCell 12 | 13 | + (CGSize)cellSize { 14 | return CGSizeMake((kScreenWidth-(15)*3-(45))/2+(15), ((kScreenWidth-(15)*3-(45))/2)*(3/2.0)); 15 | } 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame { 18 | if (self = [super initWithFrame:frame]) { 19 | [self.contentView addSubview:self.imgV]; 20 | } 21 | return self; 22 | } 23 | 24 | - (void)layoutSubviews { 25 | [super layoutSubviews]; 26 | 27 | [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) { 28 | make.top.bottom.mas_equalTo(self); 29 | make.left.mas_equalTo(self).mas_offset(15); 30 | make.right.mas_equalTo(self); 31 | }]; 32 | 33 | self.imgV.layer.cornerRadius = 4; 34 | } 35 | 36 | - (void)updateWithModel:(id)model { 37 | 38 | } 39 | 40 | - (UIImageView *)imgV { 41 | if (!_imgV) { 42 | _imgV = [[UIImageView alloc]init]; 43 | _imgV.contentMode = UIViewContentModeScaleAspectFill; 44 | _imgV.layer.masksToBounds = YES; 45 | _imgV.clipsToBounds = YES; 46 | _imgV.tag = 1000; 47 | } 48 | return _imgV; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/LawyerArticleCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LawyerArticleCollectionViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/2/27. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LawyerArticleCollectionViewCell : BaseCollectionCell 14 | 15 | - (void)updateWithModel:(id)model; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/LawyerCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LawyerCollectionViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/2/25. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LawyerCollectionViewCell : BaseCollectionCell 14 | 15 | - (void)updateWithModel:(id)model; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/NestCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "BaseCollectionCell.h" 4 | 5 | NS_ASSUME_NONNULL_BEGIN 6 | 7 | @interface NestCollectionViewCell : BaseCollectionCell 8 | 9 | - (void)updateCellWithData:(NSMutableArray *)array; 10 | 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/NewsCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABTemplateCollectionViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/3/6. 6 | // Copyright © 2019年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseCollectionCell.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NewsCollectionViewCell : BaseCollectionCell 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/TestCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestCollectionViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseCollectionCell.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class Game; 15 | 16 | @interface TestCollectionViewCell : BaseCollectionCell 17 | 18 | - (void)initWithData:(Game *)game; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CollectionView/UserCode/View/CollectionViewCell/WaterFlowCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaterFlowCollectionViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by anwenhu on 2023/2/6. 6 | // Copyright © 2023 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseCollectionCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WaterFlowCollectionViewCell : BaseCollectionCell 14 | 15 | @property (nonatomic,strong) UIImageView *leftImg; 16 | @property (nonatomic,strong) UILabel *infoLab; 17 | @property (nonatomic,strong) UILabel *titleLab; 18 | @property (nonatomic,strong) UILabel *contentLab; 19 | @property (nonatomic,strong) UILabel *timeLab; 20 | @property (nonatomic,strong) UILabel *priceLab; 21 | 22 | - (void)updateWithModel:(id)model; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CustomView/Controller/DoubanNormalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoubanNormalViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/15. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DoubanNormalViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CustomView/Controller/GradientButtonViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GradientButtonViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/11/14. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseDemoViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface GradientButtonViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CustomView/Controller/PenerateViewExampleController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PenerateViewExampleController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/12/18. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseDemoViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PenerateViewExampleController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CustomView/Controller/ViewExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AccredtationViewController.h 3 | // 4 | // Created by tigerAndBull on 2019/2/27. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface ViewExampleViewController : BaseDemoViewController 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/CustomView/View/TestHeadView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestHeadView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/20. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface TestHeadView : UIView 16 | 17 | - (void)initWithData:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/Interface/TABAnimatedControllerUIImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedControllerUIImpl.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/3. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TABAnimatedControllerUIInterface.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TABAnimatedControllerUIImpl : NSObject 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/Interface/TABAnimatedControllerUIInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimatedControllerUIInterface.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/3. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimatedControllerUIInterface_h 10 | #define TABAnimatedControllerUIInterface_h 11 | 12 | #import 13 | 14 | typedef void(^RightButtonClickBlock)(UIButton *btn); 15 | 16 | @protocol TABAnimatedControllerUIInterface 17 | 18 | @optional 19 | 20 | - (void)addRightButtonWithText:(NSString *)text controller:(UIViewController *)controller clickButtonBlock:(RightButtonClickBlock)clickButtonBlock; 21 | - (void)addReloadButtonWithController:(UIViewController *)controller clickButtonBlock:(RightButtonClickBlock)clickButtonBlock; 22 | 23 | @end 24 | 25 | #endif /* TABAnimatedControllerUIInterface_h */ 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/Options/Base/BaseOptionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseOptionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface BaseOptionViewController : BaseDemoViewController 14 | 15 | @property (nonatomic, strong) NSArray *titleArray; 16 | @property (nonatomic, strong) NSArray *controllerClassArray; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/Options/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseOptionViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MainViewController : BaseOptionViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/Options/SencondaryOptionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SencondaryOptionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseOptionViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface SencondaryOptionViewController : BaseOptionViewController 15 | 16 | @property (nonatomic, assign) NSInteger index; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Dynamic Section/TableDynamicSectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LabWithLinesViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/22. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TableDynamicSectionViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Dynamic Section/TableDynamicWithHeaderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableDynamicWithHeaderViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TableDynamicWithHeaderViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneSectionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface OneSectionViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionWithHeaderSectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneSectionWithHeaderSectionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface OneSectionWithHeaderSectionViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/OneSection/OneSectionWithTableHeaderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneSectionWithTableHeaderViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface OneSectionWithTableHeaderViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/NestTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NestTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/5. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NestTableViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/PullLoadingTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PullLoadingTableViewController.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/6/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseDemoViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PullLoadingTableViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/TableCardViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableCardViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/5. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TableCardViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/TestLayoutDelegateTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTTViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/6/20. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestLayoutDelegateTableViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/TestLayoutTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestLayoutTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by Dianshi on 2019/5/24. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Game; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TestLayoutTableViewController : BaseDemoViewController 16 | 17 | @end 18 | 19 | @interface TestLayoutCell : UITableViewCell 20 | 21 | - (void)initWithData:(Game *)game; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Others/XibTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XibTestViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface XibTestViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Partial Row/TableRowModeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleOfPackageViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TableRowModeViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Partial Section/PartialSectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PartialSectionViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface PartialSectionViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Partial Section/PartialSectionWithHeaderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PartialSectionWithHeaderViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface PartialSectionWithHeaderViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Sections/MutiSectionMutiCellTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SectionsTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MutiSectionMutiCellTableViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/Controller/Sections/MutiSectionsMutiCellWithHeaderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MutiSectionsMutiCellWithHeaderViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseDemoViewController.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface MutiSectionsMutiCellWithHeaderViewController : BaseDemoViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/DelegateSelf/Controller/DeleagteSelfTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DeleagteSelfTableViewController : BaseDemoViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/DelegateSelf/View/BaseTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTableViewCell.h 3 | // yifu 4 | // 5 | // Created by tigerAndBull on 2019/2/23. 6 | // Copyright © 2019年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class BaseViewController; 14 | 15 | @protocol BaseTableViewCellDelegate 16 | 17 | @end 18 | 19 | @interface BaseTableViewCell : UITableViewCell 20 | 21 | - (void)updateWithModel:(_Nullable id)model; 22 | 23 | + (NSNumber *)cellSizeByClass; 24 | + (NSString *)cellIdentifier; 25 | + (CGFloat)cellHeight; 26 | + (NSNumber *)cellHeightNumber; 27 | 28 | + (instancetype)cellFromTableView:(UITableView *)tableView; 29 | 30 | + (instancetype)cellFromTableView:(UITableView *)tableView 31 | indexPath:(NSIndexPath *)indexPath; 32 | 33 | @property (nonatomic,strong) BaseViewController *currentController; 34 | @property (nonatomic,weak) id delegate; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/DelegateSelf/View/DelegateSelfTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateSelfTableViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DelegateSelfTableViewCell : BaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/DelegateSelf/View/DelegateSelfTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateSelfTableViewCell.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "DelegateSelfTableViewCell.h" 10 | 11 | @implementation DelegateSelfTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/EstimatedHeight/Controller/TestLayoutDelegateTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTTViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/6/20. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestLayoutDelegateTableViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/EstimatedHeight/Controller/TestLayoutTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestLayoutTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by Dianshi on 2019/5/24. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Game; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TestLayoutTableViewController : BaseDemoViewController 16 | 17 | @end 18 | 19 | @interface TestLayoutCell : UITableViewCell 20 | 21 | - (void)initWithData:(Game *)game; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UseXib/Controller/XibTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XibTestViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface XibTestViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UseXib/View/XIBTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XIBTableViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface XIBTableViewCell : UITableViewCell 14 | 15 | - (void)updateCell; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UseXib/View/XIBTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XIBTableViewCell.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "XIBTableViewCell.h" 10 | 11 | #import "UIView+TABAnimated.h" 12 | 13 | @interface XIBTableViewCell () 14 | 15 | @property (weak, nonatomic) IBOutlet UIImageView *testImageView; 16 | @property (weak, nonatomic) IBOutlet UILabel *testLab; 17 | @property (weak, nonatomic) IBOutlet UILabel *testLab2; 18 | @property (weak, nonatomic) IBOutlet UILabel *testLab3; 19 | @property (weak, nonatomic) IBOutlet UILabel *testLab4; 20 | 21 | @end 22 | 23 | @implementation XIBTableViewCell 24 | 25 | 26 | - (void)awakeFromNib { 27 | [super awakeFromNib]; 28 | // Initialization code 29 | } 30 | 31 | - (void)updateCell { 32 | self.testLab.text = @"测试数据"; 33 | } 34 | 35 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 36 | [super setSelected:selected animated:animated]; 37 | 38 | // Configure the view for the selected state 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/Controller/TableDynamicSectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LabWithLinesViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/22. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TableDynamicSectionViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/Controller/TableNormalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TableNormalViewController : BaseDemoViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/Controller/TableRowModeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleOfPackageViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TableRowModeViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/Controller/TableSectionsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SectionsTableViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/5/9. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TableSectionsViewController : BaseDemoViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableHeaderFooterView/TestTableHeaderFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableHeaderFooterView.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestTableHeaderFooterView : UITableViewHeaderFooterView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/CardTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CardTableViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CardTableViewCell : BaseTableViewCell 14 | 15 | @property (nonatomic,strong) UIImageView *leftImg; 16 | @property (nonatomic,strong) UILabel *infoLab; 17 | @property (nonatomic,strong) UILabel *titleLab; 18 | @property (nonatomic,strong) UILabel *contentLab; 19 | @property (nonatomic,strong) UILabel *timeLab; 20 | @property (nonatomic,strong) UILabel *priceLab; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/LabWithLinesViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LabWithLinesViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/22. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface LabWithLinesViewCell : UITableViewCell 16 | 17 | - (void)initWithData:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/PackageTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PackageTableViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface PackageTableViewCell : UITableViewCell 16 | 17 | - (void)updateWithGame:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/PackageTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // PackageTableViewCell.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "PackageTableViewCell.h" 10 | #import "TestHeadView.h" 11 | #import 12 | 13 | #import "Game.h" 14 | 15 | @interface PackageTableViewCell() 16 | 17 | @property (nonatomic,strong) TestHeadView *packView; 18 | 19 | @end 20 | 21 | @implementation PackageTableViewCell 22 | 23 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 24 | [super setSelected:selected animated:animated]; 25 | // Configure the view for the selected state 26 | } 27 | 28 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 29 | 30 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 31 | 32 | if (self) { 33 | [self initUI]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)updateWithGame:(Game *)game { 39 | [self.packView initWithData:game]; 40 | } 41 | 42 | #pragma mark - Initize Methods 43 | 44 | - (void)initUI { 45 | [self addSubview:self.packView]; 46 | } 47 | 48 | #pragma mark - Lazy Methods 49 | 50 | - (TestHeadView *)packView { 51 | if (!_packView) { 52 | _packView = [[TestHeadView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 80)]; 53 | } 54 | return _packView; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/ResetFrameTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ResetFrameTableViewCell.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/25. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ResetFrameTableViewCell : UITableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/ResetFrameTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ResetFrameTableViewCell.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/4/25. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "ResetFrameTableViewCell.h" 10 | 11 | @implementation ResetFrameTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/UserCode/View/TableViewCell/TestTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GameTableViewCell.h 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/6/6. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseTableViewCell.h" 11 | 12 | @class Game; 13 | 14 | @interface TestTableViewCell : BaseTableViewCell 15 | 16 | - (void)initWithData:(Game *)game; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/BaseTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTableViewCell.h 3 | // 4 | // Created by tigerAndBull on 2019/2/23. 5 | // Copyright © 2019年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @class BaseViewController; 13 | 14 | @protocol BaseTableViewCellDelegate 15 | 16 | @end 17 | 18 | @interface BaseTableViewCell : UITableViewCell 19 | 20 | - (void)updateWithModel:(_Nullable id)model; 21 | 22 | + (NSNumber *)cellSizeByClass; 23 | + (NSString *)cellIdentifier; 24 | + (CGFloat)cellHeight; 25 | + (NSNumber *)cellHeightNumber; 26 | 27 | + (instancetype)cellFromTableView:(UITableView *)tableView; 28 | 29 | + (instancetype)cellFromTableView:(UITableView *)tableView 30 | indexPath:(NSIndexPath *)indexPath; 31 | 32 | @property (nonatomic,strong) BaseViewController *currentController; 33 | @property (nonatomic,weak) id delegate; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/CardTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CardTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/10/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CardTableViewCell : BaseTableViewCell 14 | 15 | @property (nonatomic, strong) UIView *backView; 16 | @property (nonatomic, strong) UIImageView *leftImg; 17 | @property (nonatomic, strong) UILabel *infoLab; 18 | @property (nonatomic, strong) UILabel *titleLab; 19 | @property (nonatomic, strong) UILabel *contentLab; 20 | @property (nonatomic, strong) UILabel *timeLab; 21 | @property (nonatomic, strong) UILabel *priceLab; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/DailyTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DailyTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DailyTableViewCell : BaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/DelegateSelfTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateSelfTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DelegateSelfTableViewCell : BaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/DelegateSelfTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateSelfTableViewCell.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/10. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "DelegateSelfTableViewCell.h" 10 | 11 | @implementation DelegateSelfTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/LabWithLinesViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LabWithLinesViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/22. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface LabWithLinesViewCell : UITableViewCell 16 | 17 | - (void)initWithData:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/LawyerTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LawyerTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LawyerTableViewCell : BaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/NestTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // NestTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/5. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NestTableViewCell : BaseTableViewCell 14 | 15 | - (void)updateCellWithData:(NSMutableArray *)array; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/NewsTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // NewsTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NewsTableViewCell : BaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/PackageTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PackageTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface PackageTableViewCell : UITableViewCell 16 | 17 | - (void)updateWithGame:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/PackageTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // PackageTableViewCell.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/11/17. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "PackageTableViewCell.h" 10 | #import "TestHeadView.h" 11 | #import "TABDefine.h" 12 | 13 | #import "Game.h" 14 | 15 | @interface PackageTableViewCell() 16 | 17 | @property (nonatomic,strong) TestHeadView *packView; 18 | 19 | @end 20 | 21 | @implementation PackageTableViewCell 22 | 23 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 24 | [super setSelected:selected animated:animated]; 25 | // Configure the view for the selected state 26 | } 27 | 28 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 29 | 30 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 31 | 32 | if (self) { 33 | [self initUI]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)updateWithGame:(Game *)game { 39 | [self.packView initWithData:game]; 40 | } 41 | 42 | #pragma mark - Initize Methods 43 | 44 | - (void)initUI { 45 | [self addSubview:self.packView]; 46 | } 47 | 48 | #pragma mark - Lazy Methods 49 | 50 | - (TestHeadView *)packView { 51 | if (!_packView) { 52 | _packView = [[TestHeadView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 80)]; 53 | } 54 | return _packView; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Cell/TestTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GameTableViewCell.h 3 | // TABAnimated 4 | // 5 | // Created by tigerAndBull on 2018/6/6. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseTableViewCell.h" 11 | 12 | @class Game; 13 | 14 | @interface TestTableViewCell : BaseTableViewCell 15 | 16 | - (void)initWithData:(Game *)game; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Header/LineTableViewHeaderFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LineTableViewHeaderFooterView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LineTableViewHeaderFooterView : UITableViewHeaderFooterView 14 | 15 | @property (nonatomic, strong) UIView *backView; 16 | @property (nonatomic, strong) UILabel *titleLab; 17 | @property (nonatomic, strong) UIView *lineView; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Header/LineTableViewHeaderFooterView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LineTableViewHeaderFooterView.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2020/5/4. 6 | // Copyright © 2020 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "LineTableViewHeaderFooterView.h" 10 | 11 | @implementation LineTableViewHeaderFooterView 12 | 13 | - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier { 14 | if (self = [super initWithReuseIdentifier:reuseIdentifier]) { 15 | 16 | UIView *backView = UIView.new; 17 | backView.frame = self.bounds; 18 | backView.backgroundColor = UIColor.whiteColor; 19 | self.backView = backView; 20 | [self addSubview:backView]; 21 | 22 | UILabel *lab = [[UILabel alloc] init]; 23 | lab.frame = CGRectMake(kWidth(15)+3+4, 10, 100, 50); 24 | lab.font = kBlodFont(18); 25 | lab.textColor = [UIColor blackColor]; 26 | lab.text = @"头视图"; 27 | self.titleLab = lab; 28 | [self addSubview:lab]; 29 | 30 | UIView *view = [[UIView alloc] init]; 31 | view.frame = CGRectMake(kWidth(15), 10+8+10, 3, 14); 32 | view.backgroundColor = kColor(0xE74E46FF); 33 | view.layer.cornerRadius = 1.5f; 34 | self.lineView = lab; 35 | [self addSubview:view]; 36 | } 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Header/TestTableHeaderFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestTableHeaderFooterView.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2019/8/2. 6 | // Copyright © 2019 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class Game; 14 | 15 | @interface TestTableHeaderFooterView : UITableViewHeaderFooterView 16 | 17 | - (void)initWithData:(Game *)game; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Xib/XIBTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XIBTableViewCell.h 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface XIBTableViewCell : UITableViewCell 14 | 15 | - (void)updateCell; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /TABAnimatedDemo/TABAnimatedDemo/ViewController/TableView/View/Xib/XIBTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XIBTableViewCell.m 3 | // TABAnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/7. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "XIBTableViewCell.h" 10 | 11 | @interface XIBTableViewCell () 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *testImageView; 14 | @property (weak, nonatomic) IBOutlet UILabel *testLab; 15 | @property (weak, nonatomic) IBOutlet UILabel *testLab2; 16 | @property (weak, nonatomic) IBOutlet UILabel *testLab3; 17 | @property (weak, nonatomic) IBOutlet UILabel *testLab4; 18 | 19 | @end 20 | 21 | @implementation XIBTableViewCell 22 | 23 | 24 | - (void)awakeFromNib { 25 | [super awakeFromNib]; 26 | // Initialization code 27 | } 28 | 29 | - (void)updateCell { 30 | self.testLab.text = @"测试数据"; 31 | } 32 | 33 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 34 | [super setSelected:selected animated:animated]; 35 | 36 | // Configure the view for the selected state 37 | } 38 | 39 | @end 40 | --------------------------------------------------------------------------------