├── .github └── ISSUE_TEMPLATE │ ├── bug--.md │ └── feature--.md ├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── Document ├── 使用注意事项.md ├── 侧滑手势处理.md ├── 全屏手势处理.md ├── 列表的生命周期方法处理.md └── 常用属性说明.md ├── Example ├── Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Example.xcscheme ├── Example.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── huqilin.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── Example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Examples │ │ ├── BackgroundImage │ │ │ ├── BackgroundImageViewController.h │ │ │ └── BackgroundImageViewController.m │ │ ├── Common │ │ │ ├── BaseNavigationViewController.h │ │ │ ├── BaseNavigationViewController.m │ │ │ ├── CellCustomizeViewController.h │ │ │ ├── CellCustomizeViewController.m │ │ │ ├── ContentBaseViewController.h │ │ │ ├── ContentBaseViewController.m │ │ │ ├── DetailViewController.h │ │ │ ├── DetailViewController.m │ │ │ ├── IndicatorCustomizeViewController.h │ │ │ ├── IndicatorCustomizeViewController.m │ │ │ ├── JXGradientView.h │ │ │ ├── JXGradientView.m │ │ │ ├── ListViewController.h │ │ │ ├── ListViewController.m │ │ │ ├── SpecialCustomizeViewController.h │ │ │ ├── SpecialCustomizeViewController.m │ │ │ ├── UIWindow+JXSafeArea.h │ │ │ └── UIWindow+JXSafeArea.m │ │ ├── Customize │ │ │ ├── AlignmentIndicator │ │ │ │ ├── AlignmentLineExampleViewController.h │ │ │ │ ├── AlignmentLineExampleViewController.m │ │ │ │ ├── JXCategoryIndicatorAlignmentLineView.h │ │ │ │ └── JXCategoryIndicatorAlignmentLineView.m │ │ │ ├── CountCell │ │ │ │ ├── CountCellExampleViewController.h │ │ │ │ └── CountCellExampleViewController.m │ │ │ ├── CustomizationListViewController.h │ │ │ ├── CustomizationListViewController.m │ │ │ ├── ScrollSmall │ │ │ │ ├── JXCategoryScrollSmallCell.h │ │ │ │ ├── JXCategoryScrollSmallCell.m │ │ │ │ ├── JXCategoryScrollSmallCellModel.h │ │ │ │ ├── JXCategoryScrollSmallCellModel.m │ │ │ │ ├── JXCategoryScrollSmallView.h │ │ │ │ ├── JXCategoryScrollSmallView.m │ │ │ │ ├── ScrollSmallViewController.h │ │ │ │ └── ScrollSmallViewController.m │ │ │ ├── Sort │ │ │ │ ├── JXCategoryTitleSortCell.h │ │ │ │ ├── JXCategoryTitleSortCell.m │ │ │ │ ├── JXCategoryTitleSortCellModel.h │ │ │ │ ├── JXCategoryTitleSortCellModel.m │ │ │ │ ├── JXCategoryTitleSortView.h │ │ │ │ ├── JXCategoryTitleSortView.m │ │ │ │ ├── SortExampleViewController.h │ │ │ │ └── SortExampleViewController.m │ │ │ ├── SpringIndicator │ │ │ │ ├── JXCategoryIndicatorSpringBackgroundView.h │ │ │ │ ├── JXCategoryIndicatorSpringBackgroundView.m │ │ │ │ ├── SpringIndicatorExampleViewController.h │ │ │ │ └── SpringIndicatorExampleViewController.m │ │ │ ├── TimeLine │ │ │ │ ├── JXCategoryTimelineCell.h │ │ │ │ ├── JXCategoryTimelineCell.m │ │ │ │ ├── JXCategoryTimelineCellModel.h │ │ │ │ ├── JXCategoryTimelineCellModel.m │ │ │ │ ├── JXCategoryTimelineView.h │ │ │ │ ├── JXCategoryTimelineView.m │ │ │ │ ├── TimelineExampleViewController.h │ │ │ │ └── TimelineExampleViewController.m │ │ │ ├── TitleAtrribute │ │ │ │ ├── AttributeViewViewController.h │ │ │ │ ├── AttributeViewViewController.m │ │ │ │ ├── JXCategoryTitleAttributeCell.h │ │ │ │ ├── JXCategoryTitleAttributeCell.m │ │ │ │ ├── JXCategoryTitleAttributeCellModel.h │ │ │ │ ├── JXCategoryTitleAttributeCellModel.m │ │ │ │ ├── JXCategoryTitleAttributeView.h │ │ │ │ └── JXCategoryTitleAttributeView.m │ │ │ └── TitleBackground │ │ │ │ ├── JXCategoryTitleBackgroundCell.h │ │ │ │ ├── JXCategoryTitleBackgroundCell.m │ │ │ │ ├── JXCategoryTitleBackgroundCellModel.h │ │ │ │ ├── JXCategoryTitleBackgroundCellModel.m │ │ │ │ ├── JXCategoryTitleBackgroundView.h │ │ │ │ ├── JXCategoryTitleBackgroundView.m │ │ │ │ ├── TitleBackgroundExampleViewController.h │ │ │ │ └── TitleBackgroundExampleViewController.m │ │ ├── Dot │ │ │ ├── DotViewController.h │ │ │ └── DotViewController.m │ │ ├── Football │ │ │ ├── FootballViewController.h │ │ │ └── FootballViewController.m │ │ ├── Image │ │ │ ├── ImageViewController.h │ │ │ └── ImageViewController.m │ │ ├── IndicatorImageView │ │ │ ├── IndicatorImageViewViewController.h │ │ │ └── IndicatorImageViewViewController.m │ │ ├── LoadData │ │ │ ├── LoadDataBaseViewController.h │ │ │ ├── LoadDataBaseViewController.m │ │ │ ├── LoadDataListBaseViewController.h │ │ │ ├── LoadDataListBaseViewController.m │ │ │ ├── MJRefresh │ │ │ │ ├── Base │ │ │ │ │ ├── MJRefreshAutoFooter.h │ │ │ │ │ ├── MJRefreshAutoFooter.m │ │ │ │ │ ├── MJRefreshBackFooter.h │ │ │ │ │ ├── MJRefreshBackFooter.m │ │ │ │ │ ├── MJRefreshComponent.h │ │ │ │ │ ├── MJRefreshComponent.m │ │ │ │ │ ├── MJRefreshFooter.h │ │ │ │ │ ├── MJRefreshFooter.m │ │ │ │ │ ├── MJRefreshHeader.h │ │ │ │ │ └── MJRefreshHeader.m │ │ │ │ ├── Custom │ │ │ │ │ ├── Footer │ │ │ │ │ │ ├── Auto │ │ │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ │ │ ├── MJRefreshAutoGifFooter.m │ │ │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ │ │ └── Back │ │ │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ │ │ ├── MJRefreshBackNormalFooter.m │ │ │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ │ │ └── Header │ │ │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ │ │ └── MJRefreshStateHeader.m │ │ │ │ ├── MJRefresh.bundle │ │ │ │ │ ├── arrow@2x.png │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ │ ├── zh-Hans.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ │ └── zh-Hant.lproj │ │ │ │ │ │ └── Localizable.strings │ │ │ │ ├── MJRefresh.h │ │ │ │ ├── MJRefreshConst.h │ │ │ │ ├── MJRefreshConst.m │ │ │ │ ├── NSBundle+MJRefresh.h │ │ │ │ ├── NSBundle+MJRefresh.m │ │ │ │ ├── UIScrollView+MJExtension.h │ │ │ │ ├── UIScrollView+MJExtension.m │ │ │ │ ├── UIScrollView+MJRefresh.h │ │ │ │ ├── UIScrollView+MJRefresh.m │ │ │ │ ├── UIView+MJExtension.h │ │ │ │ └── UIView+MJExtension.m │ │ │ ├── 刷新数据+UICollectionView封装列表 │ │ │ │ ├── LoadDataListCollectionListViewController.h │ │ │ │ ├── LoadDataListCollectionListViewController.m │ │ │ │ ├── LoadDataListCollectionViewController.h │ │ │ │ └── LoadDataListCollectionViewController.m │ │ │ ├── 刷新数据+UIScrollView封装列表 │ │ │ │ ├── LoadDataListContainerListViewController.h │ │ │ │ ├── LoadDataListContainerListViewController.m │ │ │ │ ├── LoadDataListContainerViewController.h │ │ │ │ └── LoadDataListContainerViewController.m │ │ │ └── 刷新数据+列表自定义 │ │ │ │ ├── LoadDataListCustomViewController.h │ │ │ │ └── LoadDataListCustomViewController.m │ │ ├── Nest │ │ │ ├── NestSubjectViewController.h │ │ │ ├── NestSubjectViewController.m │ │ │ ├── NestViewController.h │ │ │ └── NestViewController.m │ │ ├── Number │ │ │ ├── NumberViewController.h │ │ │ └── NumberViewController.m │ │ ├── PagingView │ │ │ ├── PagingViewController.h │ │ │ ├── PagingViewController.m │ │ │ ├── PagingViewTableHeaderView.h │ │ │ ├── PagingViewTableHeaderView.m │ │ │ ├── TestListBaseView.h │ │ │ └── TestListBaseView.m │ │ ├── Rearrange │ │ │ ├── RearrangeViewController.h │ │ │ └── RearrangeViewController.m │ │ ├── ScrollUp │ │ │ ├── ScrollUpListViewController.h │ │ │ ├── ScrollUpListViewController.m │ │ │ ├── ScrollUpNavigationBar.h │ │ │ ├── ScrollUpNavigationBar.m │ │ │ ├── ScrollUpViewController.h │ │ │ └── ScrollUpViewController.m │ │ ├── ScrollZoom │ │ │ ├── JXCategoryIndicatorScrollZoomLineView.h │ │ │ ├── JXCategoryIndicatorScrollZoomLineView.m │ │ │ ├── LoadDataListScrollZoomViewController.h │ │ │ ├── LoadDataListScrollZoomViewController.m │ │ │ ├── ScrollZoomViewController.h │ │ │ └── ScrollZoomViewController.m │ │ ├── SegmentedControl │ │ │ ├── NaviSegmentedControlViewController.h │ │ │ ├── NaviSegmentedControlViewController.m │ │ │ ├── SegmentedControlViewController.h │ │ │ ├── SegmentedControlViewController.m │ │ │ ├── SegmentedListViewController.h │ │ │ └── SegmentedListViewController.m │ │ ├── Title │ │ │ ├── TitleViewController.h │ │ │ └── TitleViewController.m │ │ ├── TitleImage │ │ │ ├── TitleImageSettingViewController.h │ │ │ ├── TitleImageSettingViewController.m │ │ │ ├── TitleImageViewController.h │ │ │ └── TitleImageViewController.m │ │ └── VerticalListView │ │ │ ├── 垂直列表滚动(UICollectionView) │ │ │ ├── Controller │ │ │ │ ├── VerticalListViewController.h │ │ │ │ └── VerticalListViewController.m │ │ │ ├── Model │ │ │ │ ├── VerticalListCellModel.h │ │ │ │ ├── VerticalListCellModel.m │ │ │ │ ├── VerticalListSectionModel.h │ │ │ │ └── VerticalListSectionModel.m │ │ │ └── View │ │ │ │ ├── VerticalListCell.h │ │ │ │ ├── VerticalListCell.m │ │ │ │ ├── VerticalListCollectionView.h │ │ │ │ ├── VerticalListCollectionView.m │ │ │ │ ├── VerticalSectionCategoryHeaderView.h │ │ │ │ ├── VerticalSectionCategoryHeaderView.m │ │ │ │ ├── VerticalSectionHeaderView.h │ │ │ │ └── VerticalSectionHeaderView.m │ │ │ └── 垂直列表滚动(UITableView) │ │ │ ├── Controller │ │ │ ├── VerticalListTableViewController.h │ │ │ └── VerticalListTableViewController.m │ │ │ └── View │ │ │ ├── VerticalListTableView.h │ │ │ ├── VerticalListTableView.m │ │ │ ├── VerticalTableSectionCategoryHeaderView.h │ │ │ ├── VerticalTableSectionCategoryHeaderView.m │ │ │ ├── VerticalTableSectionHeaderView.h │ │ │ └── VerticalTableSectionHeaderView.m │ ├── Images │ │ ├── Indicator │ │ │ ├── boat.png │ │ │ ├── city.png │ │ │ ├── light.png │ │ │ ├── lotus.png │ │ │ ├── river.png │ │ │ └── seaWave.png │ │ ├── JXCategoryView.png │ │ ├── JXCategoryViewStructure.png │ │ ├── apple.png │ │ ├── apple_selected.png │ │ ├── arrow_down.png │ │ ├── arrow_up.png │ │ ├── carrot.png │ │ ├── carrot_selected.png │ │ ├── crab.png │ │ ├── crab_selected.png │ │ ├── filter.png │ │ ├── football.png │ │ ├── grape.png │ │ ├── grape_selected.png │ │ ├── lobster.png │ │ ├── lobster_selected.png │ │ ├── lufei.jpg │ │ ├── watermelon.png │ │ └── watermelon_selected.png │ ├── Info.plist │ ├── PrefixHeader.pch │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ ├── JXCategoryView │ │ │ ├── JXCategoryBaseCell.h │ │ │ ├── JXCategoryBaseCellModel.h │ │ │ ├── JXCategoryBaseView.h │ │ │ ├── JXCategoryCollectionView.h │ │ │ ├── JXCategoryDotCell.h │ │ │ ├── JXCategoryDotCellModel.h │ │ │ ├── JXCategoryDotView.h │ │ │ ├── JXCategoryFactory.h │ │ │ ├── JXCategoryImageCell.h │ │ │ ├── JXCategoryImageCellModel.h │ │ │ ├── JXCategoryImageView.h │ │ │ ├── JXCategoryIndicatorBackgroundView.h │ │ │ ├── JXCategoryIndicatorBallView.h │ │ │ ├── JXCategoryIndicatorCell.h │ │ │ ├── JXCategoryIndicatorCellModel.h │ │ │ ├── JXCategoryIndicatorComponentView.h │ │ │ ├── JXCategoryIndicatorDotLineView.h │ │ │ ├── JXCategoryIndicatorImageView.h │ │ │ ├── JXCategoryIndicatorLineView.h │ │ │ ├── JXCategoryIndicatorParamsModel.h │ │ │ ├── JXCategoryIndicatorProtocol.h │ │ │ ├── JXCategoryIndicatorRainbowLineView.h │ │ │ ├── JXCategoryIndicatorTriangleView.h │ │ │ ├── JXCategoryIndicatorView.h │ │ │ ├── JXCategoryListContainerRTLCell.h │ │ │ ├── JXCategoryListContainerView.h │ │ │ ├── JXCategoryNumberCell.h │ │ │ ├── JXCategoryNumberCellModel.h │ │ │ ├── JXCategoryNumberView.h │ │ │ ├── JXCategoryTitleCell.h │ │ │ ├── JXCategoryTitleCellModel.h │ │ │ ├── JXCategoryTitleImageCell.h │ │ │ ├── JXCategoryTitleImageCellModel.h │ │ │ ├── JXCategoryTitleImageView.h │ │ │ ├── JXCategoryTitleVerticalZoomCell.h │ │ │ ├── JXCategoryTitleVerticalZoomCellModel.h │ │ │ ├── JXCategoryTitleVerticalZoomView.h │ │ │ ├── JXCategoryTitleView.h │ │ │ ├── JXCategoryView.h │ │ │ ├── JXCategoryViewAnimator.h │ │ │ ├── JXCategoryViewDefines.h │ │ │ ├── RTLManager.h │ │ │ └── UIColor+JXAdd.h │ │ └── JXPagingView │ │ │ ├── JXPagerListContainerView.h │ │ │ ├── JXPagerListRefreshView.h │ │ │ ├── JXPagerMainTableView.h │ │ │ ├── JXPagerSmoothView.h │ │ │ └── JXPagerView.h │ └── Public │ │ ├── JXCategoryView │ │ ├── JXCategoryBaseCell.h │ │ ├── JXCategoryBaseCellModel.h │ │ ├── JXCategoryBaseView.h │ │ ├── JXCategoryCollectionView.h │ │ ├── JXCategoryDotCell.h │ │ ├── JXCategoryDotCellModel.h │ │ ├── JXCategoryDotView.h │ │ ├── JXCategoryFactory.h │ │ ├── JXCategoryImageCell.h │ │ ├── JXCategoryImageCellModel.h │ │ ├── JXCategoryImageView.h │ │ ├── JXCategoryIndicatorBackgroundView.h │ │ ├── JXCategoryIndicatorBallView.h │ │ ├── JXCategoryIndicatorCell.h │ │ ├── JXCategoryIndicatorCellModel.h │ │ ├── JXCategoryIndicatorComponentView.h │ │ ├── JXCategoryIndicatorDotLineView.h │ │ ├── JXCategoryIndicatorImageView.h │ │ ├── JXCategoryIndicatorLineView.h │ │ ├── JXCategoryIndicatorParamsModel.h │ │ ├── JXCategoryIndicatorProtocol.h │ │ ├── JXCategoryIndicatorRainbowLineView.h │ │ ├── JXCategoryIndicatorTriangleView.h │ │ ├── JXCategoryIndicatorView.h │ │ ├── JXCategoryListContainerRTLCell.h │ │ ├── JXCategoryListContainerView.h │ │ ├── JXCategoryNumberCell.h │ │ ├── JXCategoryNumberCellModel.h │ │ ├── JXCategoryNumberView.h │ │ ├── JXCategoryTitleCell.h │ │ ├── JXCategoryTitleCellModel.h │ │ ├── JXCategoryTitleImageCell.h │ │ ├── JXCategoryTitleImageCellModel.h │ │ ├── JXCategoryTitleImageView.h │ │ ├── JXCategoryTitleVerticalZoomCell.h │ │ ├── JXCategoryTitleVerticalZoomCellModel.h │ │ ├── JXCategoryTitleVerticalZoomView.h │ │ ├── JXCategoryTitleView.h │ │ ├── JXCategoryView.h │ │ ├── JXCategoryViewAnimator.h │ │ ├── JXCategoryViewDefines.h │ │ ├── RTLManager.h │ │ └── UIColor+JXAdd.h │ │ └── JXPagingView │ │ ├── JXPagerListContainerView.h │ │ ├── JXPagerListRefreshView.h │ │ ├── JXPagerMainTableView.h │ │ ├── JXPagerSmoothView.h │ │ └── JXPagerView.h │ ├── JXPagingView │ ├── LICENSE │ ├── README.md │ └── Sources │ │ └── JXPagerView │ │ ├── JXPagerListContainerView.h │ │ ├── JXPagerListContainerView.m │ │ ├── JXPagerListRefreshView.h │ │ ├── JXPagerListRefreshView.m │ │ ├── JXPagerMainTableView.h │ │ ├── JXPagerMainTableView.m │ │ ├── JXPagerSmoothView.h │ │ ├── JXPagerSmoothView.m │ │ ├── JXPagerView.h │ │ └── JXPagerView.m │ ├── Local Podspecs │ └── JXCategoryView.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ ├── huqilin.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── jiaxin.xcuserdatad │ │ └── xcschemes │ │ ├── JXCategoryView.xcscheme │ │ ├── JXPagingView.xcscheme │ │ └── Pods-Example.xcscheme │ └── Target Support Files │ ├── JXCategoryView │ ├── JXCategoryView-dummy.m │ ├── JXCategoryView-prefix.pch │ └── JXCategoryView.xcconfig │ ├── JXPagingView │ ├── JXPagingView-dummy.m │ ├── JXPagingView-prefix.pch │ └── JXPagingView.xcconfig │ └── Pods-Example │ ├── Pods-Example-acknowledgements.markdown │ ├── Pods-Example-acknowledgements.plist │ ├── Pods-Example-dummy.m │ ├── Pods-Example.debug.xcconfig │ └── Pods-Example.release.xcconfig ├── JXCategoryView.podspec ├── JXCategoryView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── huqilin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ └── JXCategoryView.xcscheme └── xcuserdata │ ├── huqilin.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── jiaxin.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── JXCategoryView ├── Info.plist └── JXCategoryView.h ├── LICENSE ├── Migration ├── 1.0.0.md └── 1.5.0版本迁移指南.md ├── Package.swift ├── README.md ├── 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 │ ├── JXCategoryListContainerRTLCell.h │ ├── JXCategoryListContainerRTLCell.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 ├── PrivacyInfo.xcprivacy ├── RLTManager │ ├── RTLManager.h │ └── RTLManager.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 └── Tests ├── JXCategoryViewTests ├── JXCategoryViewTests.swift └── XCTestManifests.swift └── LinuxMain.swift /.github/ISSUE_TEMPLATE/bug--.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug提交 3 | about: 提交清晰明了的bug 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **bug提交前阅读** 11 | 1.请先仔细阅读文档,尤其是【其他注意事项】文档,里面有常见问题的解决方案; 12 | 2.请先搜索已有的Issues,尝试找到相同问题的讨论; 13 | 3.请先阅读相关类的API、源码,尝试从源码找到答案; 14 | 4.如果以上步骤都未能解决你的疑问,欢迎提交ISSUE; 15 | 16 | **bug描述** 17 | 请简单描述你的bug现象。 18 | 19 | **版本号** 20 | 1.JXCategoryView版本号:? 21 | 2.手机系统版本号:? 22 | 3.手机型号:? 23 | 24 | **复现步骤** 25 | 1. 遇到问题的相关效果、类是:? 26 | 2.具体的操作步骤是:? 27 | 28 | **截图、GIF** 29 | 提供bug出现时的截图或者GIF。 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature--.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature提交 3 | about: 提交清晰明了的Feature 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Feature描述** 11 | 请简单描述你想要的效果:? 12 | 13 | **参考效果** 14 | 如果你想要实现一个其他APP已有的效果: 15 | 1.参考APP名字:? 16 | 2.目标页面路径:? 17 | 3.目标效果截图:? 18 | 19 | **其他补充** 20 | 关于目标效果的其他说明:? 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/xcode 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=xcode 4 | 5 | ### Xcode ### 6 | # Xcode 7 | # 8 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 9 | 10 | ## User settings 11 | xcuserdata/ 12 | 13 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 14 | *.xcscmblueprint 15 | *.xccheckout 16 | 17 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 18 | build/ 19 | DerivedData/ 20 | *.moved-aside 21 | *.pbxuser 22 | !default.pbxuser 23 | *.mode1v3 24 | !default.mode1v3 25 | *.mode2v3 26 | !default.mode2v3 27 | *.perspectivev3 28 | !default.perspectivev3 29 | 30 | ## Gcc Patch 31 | /*.gcno 32 | 33 | ### Xcode Patch ### 34 | *.xcodeproj/* 35 | !*.xcodeproj/project.pbxproj 36 | !*.xcodeproj/xcshareddata/ 37 | !*.xcworkspace/contents.xcworkspacedata 38 | **/xcshareddata/WorkspaceSettings.xcsettings 39 | 40 | # End of https://www.toptal.com/developers/gitignore/api/xcode 41 | Example/Pods/Target Support Files/JXCategoryView/JXCategoryView.debug.xcconfig 42 | Example/Pods/Target Support Files/JXCategoryView/JXCategoryView.release.xcconfig 43 | Example/Pods/Target Support Files/JXPagingView/JXPagingView.debug.xcconfig 44 | Example/Pods/Target Support Files/JXPagingView/JXPagingView.release.xcconfig 45 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Document/侧滑手势处理.md: -------------------------------------------------------------------------------- 1 | # 侧滑手势处理说明文档 2 | 3 | **重点说明**: 4 | 侧滑手势处理的结果是:当前页面处于第一页的时候,才允许侧滑手势返回上一页。处于其他页面的时候,在屏幕边缘侧滑只会响应列表页面的左右滚动。这样做的目标便于用户停留在当前页面,进行列表的切换浏览。 5 | 6 | 如果产品经理不需要这样的特性,希望侧滑手势任何情况都能响应,就不需要参看此教程,不做任何处理即可。 7 | 8 | ## `UIViewController`生命周期方法处理 9 | 10 | ```Objective-c 11 | - (void)viewDidAppear:(BOOL)animated { 12 | [super viewDidAppear:animated]; 13 | 14 | //处于第一个item的时候,才允许屏幕边缘手势返回 15 | self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0); 16 | } 17 | 18 | - (void)viewWillDisappear:(BOOL)animated { 19 | [super viewWillDisappear:animated]; 20 | 21 | //离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面 22 | self.navigationController.interactivePopGestureRecognizer.enabled = YES; 23 | } 24 | ``` 25 | 26 | ## `JXCategoryViewDelegate`选中代理方法处理 27 | 28 | ```Objective-c 29 | (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { 30 | self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); 31 | } 32 | ``` 33 | 34 | ## 自定义导航栏返回Item,除了添加上面的代码,还需要下面的额外处理 35 | 36 | - 设置代理: 37 | ```Objective-c 38 | self.navigationController.interactivePopGestureRecognizer.delegate = self; 39 | ``` 40 | 41 | - 设置手势代理方法 42 | ```Objective-c 43 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 44 | return YES; 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Document/全屏手势处理.md: -------------------------------------------------------------------------------- 1 | # 全屏手势处理 2 | 3 | 这里主要针对`FDFullscreenPopGesture`示例处理,其他同类手势即可按照此方法处理。 4 | 5 | ## 准备 6 | 7 | - `JXCategoryView`版本需要 **1.3.4** 版本及以上; 8 | 9 | ## `JXCategoryCollectionView`处理 10 | 11 | - 遵从`JXCategoryCollectionViewGestureDelegate`协议 12 | 13 | ```Objective-C 14 | self.categoryView.collectionView.gestureDelegate = self 15 | ``` 16 | 17 | - 实现相关代理方法 18 | 19 | ```Objective-C 20 | - (BOOL)categoryCollectionView:(JXCategoryCollectionView *)collectionView gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 21 | if (collectionView.contentOffset.x <= 0) { 22 | if ([otherGestureRecognizer.delegate isKindOfClass:NSClassFromString(@"_FDFullscreenPopGestureRecognizerDelegate")]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | ``` 29 | 30 | ## `JXCategoryListContainerView`处理 31 | 32 | - 遵从`JXCategoryListContainerViewDelegate`协议 33 | 34 | - 实现相关代理方法 35 | 36 | ```Objective-C 37 | - (UIScrollView *)scrollViewInlistContainerView:(JXCategoryListContainerView *)listContainerView { 38 | //返回一个继承自`UIScrollView`的自定义类,然后自己在自定义类内部,处理手势。 39 | return customScrollView; 40 | } 41 | ``` -------------------------------------------------------------------------------- /Document/列表的生命周期方法处理.md: -------------------------------------------------------------------------------- 1 | # 列表的生命周期方法处理 2 | 3 | ## 列表的自定义生命周期方法有哪些? 4 | 5 | ```Objective-C 6 | /** 7 | 可选实现,列表将要显示的时候调用 8 | */ 9 | - (void)listWillAppear; 10 | 11 | /** 12 | 可选实现,列表显示的时候调用 13 | */ 14 | - (void)listDidAppear; 15 | 16 | /** 17 | 可选实现,列表将要消失的时候调用 18 | */ 19 | - (void)listWillDisappear; 20 | 21 | /** 22 | 可选实现,列表消失的时候调用 23 | */ 24 | - (void)listDidDisappear; 25 | ``` 26 | 27 | 28 | ## 列表的生命周期方法触发时机 29 | 30 | 以当前显示的是A列表,右边是B列表,作为例子说明: 31 | 当用户从A慢慢滚动到B时,B显示了一点点的时候,就会触发A的`listWillDisappear`和B的`listWillAppear`。 32 | 33 | 等用户完全滚动到B时(即B全部显示到界面,A全部消失),触发A的`listDidDisappear`和B的`listDidAppear`。 34 | 35 | ## 如果列表是UIViewController类,系统的`ViewWillAppear:`等生命周期方法会触发吗? 36 | 37 | 系统的生命周期方法: 38 | ``` 39 | - (void)viewWillAppear:(BOOL)animated; 40 | - (void)viewDidAppear:(BOOL)animated; 41 | - (void)viewWillDisappear:(BOOL)animated; 42 | - (void)viewDidDisappear:(BOOL)animated; 43 | ``` 44 | 都会按照【列表的生命周期触发时机】说明中的顺序触发。但是自定义的`- (void)listWillAppear;`等生命周期方法也会调用,所以,如果列表是UIViewController类,只依赖于系统的生命周期方法即可。如果列表是UIView类,就依赖于自定义的生命周期方法即可。 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/huqilin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example.xcworkspace/xcuserdata/huqilin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcuserdata/huqilin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Example 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Example 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | // Override point for customization after application launch. 15 | [self setupNavigationBar]; 16 | return YES; 17 | } 18 | 19 | - (void)setupNavigationBar { 20 | if (@available(iOS 13.0, *)) { 21 | UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init]; 22 | [appearance configureWithOpaqueBackground]; 23 | [UINavigationBar appearance].standardAppearance = appearance; 24 | [UINavigationBar appearance].scrollEdgeAppearance = appearance; 25 | } 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Example/Examples/BackgroundImage/BackgroundImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BackgroundImageViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/9. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | /// 指示器样式 - ImageView Cell背景 12 | @interface BackgroundImageViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/BackgroundImage/BackgroundImageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BackgroundImageViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/9. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "BackgroundImageViewController.h" 10 | #import "JXCategoryTitleView.h" 11 | 12 | @interface BackgroundImageViewController () 13 | @property (nonatomic, strong) JXCategoryTitleView *myCategoryView; 14 | @end 15 | 16 | @implementation BackgroundImageViewController 17 | 18 | - (instancetype)init { 19 | self = [super init]; 20 | if (self) { 21 | self.titles = @[@"周杰伦", @"王力宏", @"林俊杰", @"潘玮柏", @"陶吉吉", @"薛之谦", @"五月天", @"毛不易"]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | self.title = @"最佳男歌手们"; 30 | 31 | // 初始化分页菜单视图 32 | self.myCategoryView.titles = self.titles; 33 | self.myCategoryView.titleColorGradientEnabled = YES; 34 | 35 | // 初始化指示器视图 36 | JXCategoryIndicatorImageView *indicatorImageView = [[JXCategoryIndicatorImageView alloc] init]; 37 | indicatorImageView.indicatorImageView.image = [UIImage imageNamed:@"light"]; 38 | indicatorImageView.indicatorImageViewSize = CGSizeMake(50, 50); 39 | self.myCategoryView.indicators = @[indicatorImageView]; 40 | } 41 | 42 | - (JXCategoryTitleView *)myCategoryView { 43 | return (JXCategoryTitleView *)self.categoryView; 44 | } 45 | 46 | - (JXCategoryBaseView *)preferredCategoryView { 47 | return [[JXCategoryTitleView alloc] init]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/BaseNavigationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseNavigationViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/3/4. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// 导航视图控制器基类 14 | @interface BaseNavigationViewController : UINavigationController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/BaseNavigationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseNavigationViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/3/4. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "BaseNavigationViewController.h" 10 | 11 | @interface BaseNavigationViewController () 12 | 13 | @end 14 | 15 | @implementation BaseNavigationViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.interactivePopGestureRecognizer.delegate = self; 21 | self.interactivePopGestureRecognizer.enabled = YES; 22 | } 23 | 24 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 25 | return YES; 26 | } 27 | 28 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 29 | if (self.viewControllers.count == 1) { 30 | return NO; 31 | } 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/CellCustomizeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CellCustomizeViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 2.「Cell 样式」列表视图控制器 12 | @interface CellCustomizeViewController : UITableViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/ContentBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/9. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryView.h" 11 | #import "JXCategoryListContainerView.h" 12 | 13 | #define WindowsSize [UIScreen mainScreen].bounds.size 14 | 15 | /// 视图控制器基类 16 | @interface ContentBaseViewController : UIViewController 17 | 18 | @property (nonatomic, strong) NSArray *titles; 19 | @property (nonatomic, strong) JXCategoryBaseView *categoryView; 20 | @property (nonatomic, strong) JXCategoryListContainerView *listContainerView; 21 | @property (nonatomic, assign) BOOL isNeedIndicatorPositionChangeItem; 22 | 23 | - (JXCategoryBaseView *)preferredCategoryView; 24 | - (CGFloat)preferredCategoryViewHeight; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/25. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DetailViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/25. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | 11 | @interface DetailViewController () 12 | @property (nonatomic, strong) UILabel *testLabel; 13 | @end 14 | 15 | @implementation DetailViewController 16 | 17 | #pragma mark - View life cycle 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.title = @"测试详情页面"; 23 | self.view.backgroundColor = [UIColor whiteColor]; 24 | 25 | self.testLabel = [[UILabel alloc] init]; 26 | self.testLabel.text = @"这是一个测试详情页面\n点击空白处返回上一级页面或关闭页面"; 27 | self.testLabel.numberOfLines = 0; 28 | self.testLabel.textAlignment = NSTextAlignmentCenter; 29 | self.testLabel.textColor = [UIColor blackColor]; 30 | self.testLabel.font = [UIFont systemFontOfSize:20]; 31 | [self.view addSubview:self.testLabel]; 32 | } 33 | 34 | - (void)viewDidLayoutSubviews { 35 | [super viewDidLayoutSubviews]; 36 | 37 | [self.testLabel sizeToFit]; 38 | self.testLabel.center = self.view.center; 39 | } 40 | 41 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 42 | if (self.presentingViewController || self.navigationController.presentingViewController) { 43 | [self dismissViewControllerAnimated:true completion:nil]; 44 | }else { 45 | [self.navigationController popViewControllerAnimated:true]; 46 | } 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/IndicatorCustomizeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IndicatorCustomizeViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 1.「指示器样式」列表视图控制器 12 | @interface IndicatorCustomizeViewController : UITableViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/JXGradientView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXGradientView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/20. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | 渐变视图 15 | 16 | 在「指示器样式」——>「BackgroundView渐变色」 中有用到! 17 | */ 18 | @interface JXGradientView : UIView 19 | 20 | @property (nonatomic, strong, readonly) CAGradientLayer *gradientLayer; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/JXGradientView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXGradientView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/20. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXGradientView.h" 10 | 11 | @implementation JXGradientView 12 | 13 | + (Class)layerClass { 14 | return [CAGradientLayer class]; 15 | } 16 | 17 | - (CAGradientLayer *)gradientLayer { 18 | return (CAGradientLayer *)self.layer; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/ListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryListContainerView.h" 11 | 12 | /** 13 | 列表实例对象 14 | 15 | 在 .h 头文件中声明遵守 协议 16 | */ 17 | @interface ListViewController : UIViewController 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/ListViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ListViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ListViewController.h" 10 | 11 | #define COLOR_WITH_RGB(R,G,B,A) [UIColor colorWithRed:R green:G blue:B alpha:A] 12 | 13 | @implementation ListViewController 14 | 15 | - (void)viewDidLoad { 16 | [super viewDidLoad]; 17 | 18 | // 设置背景颜色:随机色 19 | self.view.backgroundColor = COLOR_WITH_RGB(arc4random()%255/255.0, arc4random()%255/255.0, arc4random()%255/255.0, 1); 20 | } 21 | 22 | #pragma mark - JXCategoryListContentViewDelegate 23 | 24 | /** 25 | 实现 协议方法,返回该视图控制器所拥有的「视图」 26 | */ 27 | - (UIView *)listView { 28 | return self.view; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/SpecialCustomizeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpecialCustomizeViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 3.「特殊效果」列表视图控制器 12 | @interface SpecialCustomizeViewController : UITableViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/UIWindow+JXSafeArea.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+JXSafeArea.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/9/29. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIWindow (JXSafeArea) 14 | 15 | - (UIEdgeInsets)jx_layoutInsets; 16 | 17 | - (CGFloat)jx_navigationHeight; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Example/Example/Examples/Common/UIWindow+JXSafeArea.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+JXSafeArea.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/9/29. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "UIWindow+JXSafeArea.h" 10 | 11 | @implementation UIWindow (JXSafeArea) 12 | 13 | - (UIEdgeInsets)jx_layoutInsets { 14 | if (@available(iOS 11.0, *)) { 15 | UIEdgeInsets safeAreaInsets = self.safeAreaInsets; 16 | if (safeAreaInsets.bottom > 0) { 17 | //参考文章:https://mp.weixin.qq.com/s/Ik2zBox3_w0jwfVuQUJAUw 18 | return safeAreaInsets; 19 | } 20 | return UIEdgeInsetsMake(20, 0, 0, 0); 21 | } 22 | return UIEdgeInsetsMake(20, 0, 0, 0); 23 | } 24 | 25 | - (CGFloat)jx_navigationHeight { 26 | CGFloat statusBarHeight = [self jx_layoutInsets].top; 27 | return statusBarHeight + 44; 28 | } 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/AlignmentIndicator/AlignmentLineExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlignmentLineExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "TitleViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface AlignmentLineExampleViewController : TitleViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/AlignmentIndicator/JXCategoryIndicatorAlignmentLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorAlignmentLineView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorComponentView.h" 10 | 11 | typedef NS_ENUM(NSUInteger, JXCategoryIndicatorAlignmentStyle) { 12 | JXCategoryIndicatorAlignmentStyleLeading, 13 | JXCategoryIndicatorAlignmentStyleTrailing, 14 | }; 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface JXCategoryIndicatorAlignmentLineView : JXCategoryIndicatorComponentView 19 | @property (nonatomic, assign) JXCategoryIndicatorAlignmentStyle alignmentStyle; 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/CountCell/CountCellExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CountCellExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CountCellExampleViewController : ContentBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/CustomizationListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomizationListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// 4.「自定义效果示例」列表视图控制器 14 | @interface CustomizationListViewController : UITableViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/ScrollSmall/JXCategoryScrollSmallCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryScrollSmallCell.h 3 | // Example 4 | // 5 | // Created by tony on 2021/10/22. 6 | // Copyright © 2021 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryTitleCell.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface JXCategoryScrollSmallCell : JXCategoryTitleCell 15 | - (void)refreshBottomAlpha:(CGFloat)alpha; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/ScrollSmall/JXCategoryScrollSmallCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryScrollSmallCellModel.h 3 | // Example 4 | // 5 | // Created by tony on 2021/10/22. 6 | // Copyright © 2021 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryTitleCellModel.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface JXCategoryScrollSmallCellModel : JXCategoryTitleCellModel 15 | 16 | @property (nonatomic, copy) NSString *bottomTitle; 17 | 18 | @property (nonatomic, strong) UIColor *bottomTitleNormalColor; 19 | 20 | @property (nonatomic, strong) UIColor *bottomTitleSelectedColor; 21 | 22 | @property (nonatomic, strong) UIFont *bottomTitleFont; 23 | 24 | @property (nonatomic, strong) UIFont *bottomTitleSelectedFont; 25 | 26 | @property (nonatomic, assign) CGFloat bottomAlpha; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/ScrollSmall/JXCategoryScrollSmallCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryScrollSmallCellModel.m 3 | // Example 4 | // 5 | // Created by tony on 2021/10/22. 6 | // Copyright © 2021 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryScrollSmallCellModel.h" 10 | 11 | @implementation JXCategoryScrollSmallCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/ScrollSmall/JXCategoryScrollSmallView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryScrollSmallView.h 3 | // Example 4 | // 5 | // Created by tony on 2021/10/22. 6 | // Copyright © 2021 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryTitleView.h" 11 | #import "JXCategoryScrollSmallCell.h" 12 | #import "JXCategoryScrollSmallCellModel.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface JXCategoryScrollSmallView : JXCategoryTitleView 17 | @property (nonatomic, strong) NSArray *bottomTitles; 18 | @property (nonatomic, strong) UIColor *bottomTitleNormalColor; 19 | @property (nonatomic, strong) UIColor *bottomTitleSelectedColor; 20 | @property (nonatomic, strong) UIFont *bottomTitleFont; 21 | @property (nonatomic, strong) UIFont *bottomTitleSelectedFont; 22 | @property (nonatomic, assign) CGFloat bottomAlpha; 23 | - (void)refreshBottomAlpha:(CGFloat)alpha; 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/ScrollSmall/ScrollSmallViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollSmallViewController.h 3 | // Example 4 | // 5 | // Created by tony on 2021/10/22. 6 | // Copyright © 2021 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ScrollSmallViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/JXCategoryTitleSortCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleSortCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTitleSortCell : JXCategoryTitleCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/JXCategoryTitleSortCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleSortCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | typedef NS_ENUM(NSUInteger, JXCategoryTitleSortUIType) { 12 | JXCategoryTitleSortUIType_ArrowBoth, 13 | JXCategoryTitleSortUIType_ArrowDown, 14 | JXCategoryTitleSortUIType_ArrowNone, 15 | JXCategoryTitleSortUIType_SingleImage, 16 | }; 17 | 18 | typedef NS_ENUM(NSUInteger, JXCategoryTitleSortArrowDirection) { 19 | JXCategoryTitleSortArrowDirection_Down, 20 | JXCategoryTitleSortArrowDirection_Up, 21 | JXCategoryTitleSortArrowDirection_Both, 22 | }; 23 | 24 | @interface JXCategoryTitleSortCellModel : JXCategoryTitleCellModel 25 | 26 | @property (nonatomic, assign) JXCategoryTitleSortUIType uiType; 27 | @property (nonatomic, assign) JXCategoryTitleSortArrowDirection arrowDirection; 28 | @property (nonatomic, strong) UIImage *singleImage; 29 | 30 | @end 31 | 32 | 33 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/JXCategoryTitleSortCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleSortCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleSortCellModel.h" 10 | 11 | @implementation JXCategoryTitleSortCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/JXCategoryTitleSortView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleSortView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryTitleSortCellModel.h" 11 | #import "JXCategoryTitleSortCell.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface JXCategoryTitleSortView : JXCategoryTitleView 16 | @property (nonatomic, strong) NSMutableDictionary *uiTypes;//@(index):@(JXCategoryTitleSortUIType) 17 | @property (nonatomic, strong) NSMutableDictionary *arrowDirections; //@(index):@(JXCategoryTitleSortArrowDirection) 18 | @property (nonatomic, strong) NSMutableDictionary *singleImages;//@(index):UIImage 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/JXCategoryTitleSortView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleSortView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleSortView.h" 10 | 11 | @implementation JXCategoryTitleSortView 12 | 13 | - (void)initializeData { 14 | [super initializeData]; 15 | 16 | } 17 | 18 | //返回自定义的cell class 19 | - (Class)preferredCellClass { 20 | return [JXCategoryTitleSortCell class]; 21 | } 22 | 23 | - (void)refreshDataSource { 24 | NSMutableArray *tempArray = [NSMutableArray array]; 25 | for (int i = 0; i < self.titles.count; i++) { 26 | JXCategoryTitleSortCellModel *cellModel = [[JXCategoryTitleSortCellModel alloc] init]; 27 | [tempArray addObject:cellModel]; 28 | } 29 | self.dataSource = tempArray; 30 | } 31 | 32 | - (void)refreshCellModel:(JXCategoryBaseCellModel *)cellModel index:(NSInteger)index { 33 | [super refreshCellModel:cellModel index:index]; 34 | 35 | JXCategoryTitleSortCellModel *myModel = (JXCategoryTitleSortCellModel *)cellModel; 36 | myModel.uiType = (JXCategoryTitleSortUIType)(self.uiTypes[@(index)].integerValue); 37 | myModel.arrowDirection = (JXCategoryTitleSortArrowDirection)(self.arrowDirections[@(index)].integerValue); 38 | myModel.singleImage = self.singleImages[@(index)]; 39 | } 40 | 41 | - (CGFloat)preferredCellWidthAtIndex:(NSInteger)index { 42 | CGFloat cellWidth = [super preferredCellWidthAtIndex:index]; 43 | JXCategoryTitleSortUIType uiType = (JXCategoryTitleSortUIType)(self.uiTypes[@(index)].integerValue); 44 | if (uiType == JXCategoryTitleSortUIType_ArrowNone) { 45 | return cellWidth; 46 | } 47 | return cellWidth + 3 + 10; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/Sort/SortExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SortExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/9. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SortExampleViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/SpringIndicator/JXCategoryIndicatorSpringBackgroundView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorSpringBackgroundView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorBackgroundView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryIndicatorSpringBackgroundView : JXCategoryIndicatorBackgroundView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/SpringIndicator/JXCategoryIndicatorSpringBackgroundView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorSpringBackgroundView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorSpringBackgroundView.h" 10 | 11 | @implementation JXCategoryIndicatorSpringBackgroundView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | self.indicatorHeight = 20; 18 | self.scrollAnimationDuration = 0.5; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)jx_selectedCell:(JXCategoryIndicatorParamsModel *)model { 24 | CGFloat width = [self indicatorWidthValue:model.selectedCellFrame]; 25 | CGFloat height = [self indicatorHeightValue:model.selectedCellFrame]; 26 | CGFloat x = model.selectedCellFrame.origin.x + (model.selectedCellFrame.size.width - width)/2; 27 | CGFloat y = (model.selectedCellFrame.size.height - height)/2; 28 | CGRect toFrame = CGRectMake(x, y, width, height); 29 | 30 | if (self.isScrollEnabled) { 31 | [UIView animateWithDuration:self.scrollAnimationDuration delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 32 | self.frame = toFrame; 33 | } completion:nil]; 34 | }else { 35 | self.frame = toFrame; 36 | } 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/SpringIndicator/SpringIndicatorExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpringIndicatorExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "TitleViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SpringIndicatorExampleViewController : TitleViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/SpringIndicator/SpringIndicatorExampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpringIndicatorExampleViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/20. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "SpringIndicatorExampleViewController.h" 10 | #import "JXCategoryIndicatorSpringBackgroundView.h" 11 | 12 | @interface SpringIndicatorExampleViewController () 13 | 14 | @end 15 | 16 | @implementation SpringIndicatorExampleViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | JXCategoryIndicatorSpringBackgroundView *lineView = [[JXCategoryIndicatorSpringBackgroundView alloc] init]; 22 | ((JXCategoryIndicatorView *)self.categoryView).indicators = @[lineView]; 23 | } 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TimeLine/JXCategoryTimelineCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTimelineCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/23. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTimelineCell : JXCategoryTitleCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TimeLine/JXCategoryTimelineCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTimelineCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/23. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTimelineCellModel : JXCategoryTitleCellModel 14 | 15 | @property (nonatomic, copy) NSString *timeTitle; 16 | 17 | @property (nonatomic, strong) UIColor *timeTitleNormalColor; 18 | 19 | @property (nonatomic, strong) UIColor *timeTitleSelectedColor; 20 | 21 | @property (nonatomic, strong) UIFont *timeTitleFont; 22 | 23 | @property (nonatomic, strong) UIFont *timeTitleSelectedFont; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TimeLine/JXCategoryTimelineCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTimelineCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/23. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTimelineCellModel.h" 10 | 11 | @implementation JXCategoryTimelineCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TimeLine/JXCategoryTimelineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTimelineView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/23. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryTimelineCell.h" 11 | #import "JXCategoryTimelineCellModel.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface JXCategoryTimelineView : JXCategoryTitleView 16 | @property (nonatomic, strong) NSArray *timeTitles; 17 | @property (nonatomic, strong) UIColor *timeTitleNormalColor; 18 | @property (nonatomic, strong) UIColor *timeTitleSelectedColor; 19 | @property (nonatomic, strong) UIFont *timeTitleFont; 20 | @property (nonatomic, strong) UIFont *timeTitleSelectedFont; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TimeLine/TimelineExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TimelineExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/23. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TimelineExampleViewController : ContentBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/AttributeViewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AttributeViewViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface AttributeViewViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/JXCategoryTitleAttributeCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleAttributeCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | @interface JXCategoryTitleAttributeCell : JXCategoryTitleCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/JXCategoryTitleAttributeCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleAttributeCell.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleAttributeCell.h" 10 | #import "JXCategoryTitleAttributeCellModel.h" 11 | 12 | @implementation JXCategoryTitleAttributeCell 13 | 14 | - (void)initializeViews { 15 | [super initializeViews]; 16 | 17 | self.titleLabel.numberOfLines = 2; 18 | self.maskTitleLabel.numberOfLines = 2; 19 | } 20 | 21 | - (void)reloadData:(JXCategoryBaseCellModel *)cellModel { 22 | [super reloadData:cellModel]; 23 | 24 | JXCategoryTitleAttributeCellModel *myCellModel = (JXCategoryTitleAttributeCellModel *)cellModel; 25 | 26 | self.titleLabel.numberOfLines = myCellModel.titleNumberOfLines; 27 | if (myCellModel.isSelected && myCellModel.selectedAttributeTitle != nil) { 28 | self.titleLabel.attributedText = myCellModel.selectedAttributeTitle; 29 | }else { 30 | self.titleLabel.attributedText = myCellModel.attributeTitle; 31 | } 32 | 33 | self.maskTitleLabel.numberOfLines = myCellModel.titleNumberOfLines; 34 | if (myCellModel.isSelected && myCellModel.selectedAttributeTitle != nil) { 35 | self.maskTitleLabel.attributedText = myCellModel.selectedAttributeTitle; 36 | }else { 37 | self.maskTitleLabel.attributedText = myCellModel.attributeTitle; 38 | } 39 | } 40 | 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/JXCategoryTitleAttributeCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleAttributeCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | @interface JXCategoryTitleAttributeCellModel : JXCategoryTitleCellModel 12 | 13 | @property (nonatomic, copy) NSAttributedString *attributeTitle; 14 | @property (nonatomic, copy) NSAttributedString *selectedAttributeTitle; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/JXCategoryTitleAttributeCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleAttributeCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleAttributeCellModel.h" 10 | 11 | @implementation JXCategoryTitleAttributeCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleAtrribute/JXCategoryTitleAttributeView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleAttributeView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryTitleAttributeCell.h" 11 | #import "JXCategoryTitleAttributeCellModel.h" 12 | 13 | /** 14 | 继承于`JXCategoryTitleView`的titleColor、titleSelectedColor、titleColorGradientEnabled、titleFont、titleSelectedFont属性失效,相关属性依赖于attributeTitles和selectedAttributeTitles。 15 | 16 | */ 17 | @interface JXCategoryTitleAttributeView : JXCategoryTitleView 18 | 19 | @property (nonatomic, strong) NSArray *attributeTitles; 20 | @property (nonatomic, strong) NSArray *selectedAttributeTitles; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/JXCategoryTitleBackgroundCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleBackgroundCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryTitleBackgroundCell : JXCategoryTitleCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/JXCategoryTitleBackgroundCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleBackgroundCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleCellModel.h" 10 | 11 | @interface JXCategoryTitleBackgroundCellModel : JXCategoryTitleCellModel 12 | 13 | @property (nonatomic, strong) UIColor *normalBackgroundColor; 14 | @property (nonatomic, strong) UIColor *normalBorderColor; 15 | @property (nonatomic, strong) UIColor *selectedBackgroundColor; 16 | @property (nonatomic, strong) UIColor *selectedBorderColor; 17 | @property (nonatomic, assign) CGFloat borderLineWidth; 18 | @property (nonatomic, assign) CGFloat backgroundCornerRadius; 19 | @property (nonatomic, assign) CGFloat backgroundWidth; 20 | @property (nonatomic, assign) CGFloat backgroundHeight; 21 | @end 22 | 23 | 24 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/JXCategoryTitleBackgroundCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleBackgroundCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleBackgroundCellModel.h" 10 | 11 | @implementation JXCategoryTitleBackgroundCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/JXCategoryTitleBackgroundView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleBackgroundView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | #import "JXCategoryTitleBackgroundCellModel.h" 11 | #import "JXCategoryTitleBackgroundCell.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface JXCategoryTitleBackgroundView : JXCategoryTitleView 16 | 17 | @property (nonatomic, strong) UIColor *normalBackgroundColor; 18 | @property (nonatomic, strong) UIColor *normalBorderColor; 19 | @property (nonatomic, strong) UIColor *selectedBackgroundColor; 20 | @property (nonatomic, strong) UIColor *selectedBorderColor; 21 | @property (nonatomic, assign) CGFloat borderLineWidth; 22 | @property (nonatomic, assign) CGFloat backgroundCornerRadius; 23 | @property (nonatomic, assign) CGFloat backgroundWidth; 24 | @property (nonatomic, assign) CGFloat backgroundHeight; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/TitleBackgroundExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TitleBackgroundExampleViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TitleBackgroundExampleViewController : ContentBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Customize/TitleBackground/TitleBackgroundExampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TitleBackgroundExampleViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/16. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "TitleBackgroundExampleViewController.h" 10 | #import "JXCategoryTitleBackgroundView.h" 11 | 12 | @interface TitleBackgroundExampleViewController () 13 | @property (nonatomic, strong) JXCategoryTitleBackgroundView *myCategoryView; 14 | @end 15 | 16 | @implementation TitleBackgroundExampleViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | self.titles = @[@"螃蟹", @"麻辣小龙虾", @"苹果", @"营养胡萝卜", @"葡萄", @"美味西瓜", @"香蕉", @"香甜菠萝", @"鸡肉", @"鱼", @"海星"]; 22 | self.myCategoryView.titles = self.titles; 23 | } 24 | 25 | - (JXCategoryTitleBackgroundView *)myCategoryView { 26 | return (JXCategoryTitleBackgroundView *)self.categoryView; 27 | } 28 | 29 | - (JXCategoryBaseView *)preferredCategoryView { 30 | return [[JXCategoryTitleBackgroundView alloc] init]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Example/Example/Examples/Dot/DotViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DotViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface DotViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Football/FootballViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FootballViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/10. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | /// 指示器样式 - ImageView足球滚动 12 | @interface FootballViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/Football/FootballViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FootballViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/10. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "FootballViewController.h" 10 | 11 | @interface FootballViewController () 12 | @property (nonatomic, strong) JXCategoryTitleView *myCategoryView; 13 | @end 14 | 15 | @implementation FootballViewController 16 | 17 | - (instancetype)init { 18 | self = [super init]; 19 | if (self) { 20 | self.titles = @[@"中国U-19", @"中国超级联赛", @"亚足联冠军联赛", @"亚运会足球赛", @"世界杯🎉"]; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | 28 | self.isNeedIndicatorPositionChangeItem = YES; 29 | 30 | // 初始化分页菜单视图 31 | self.myCategoryView.titles = self.titles; 32 | self.myCategoryView.titleColorGradientEnabled = YES; 33 | 34 | // 初始化指示器视图 35 | JXCategoryIndicatorImageView *indicatorImageView = [[JXCategoryIndicatorImageView alloc] init]; 36 | // MARK: 开启图片滚动效果 37 | indicatorImageView.indicatorImageViewRollEnabled = YES; 38 | indicatorImageView.indicatorImageView.image = [UIImage imageNamed:@"football"]; 39 | self.myCategoryView.indicators = @[indicatorImageView]; 40 | } 41 | 42 | - (void)viewDidLayoutSubviews { 43 | [super viewDidLayoutSubviews]; 44 | 45 | self.categoryView.frame = CGRectMake(0, 20, WindowsSize.width, 60); 46 | } 47 | 48 | - (JXCategoryTitleView *)myCategoryView { 49 | return (JXCategoryTitleView *)self.categoryView; 50 | } 51 | 52 | - (JXCategoryBaseView *)preferredCategoryView { 53 | return [[JXCategoryTitleView alloc] init]; 54 | } 55 | 56 | - (CGFloat)preferredCategoryViewHeight { 57 | return 100; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/Example/Examples/Image/ImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface ImageViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/IndicatorImageView/IndicatorImageViewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IndicatorImageViewViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/9. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | /// 指示器样式 - ImageView底部 12 | @interface IndicatorImageViewViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/LoadDataBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataBaseViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/19. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define WindowsSize [UIScreen mainScreen].bounds.size 12 | 13 | @interface LoadDataBaseViewController : UIViewController 14 | 15 | - (NSArray *)getRandomTitles; 16 | - (void)reloadData; 17 | 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/LoadDataBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataBaseViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/19. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "LoadDataBaseViewController.h" 10 | 11 | @interface LoadDataBaseViewController () 12 | 13 | @end 14 | 15 | @implementation LoadDataBaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | 22 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"刷新数据" style:UIBarButtonItemStylePlain target:self action:@selector(reloadData)]; 23 | self.navigationItem.rightBarButtonItem = rightItem; 24 | } 25 | 26 | - (NSArray *)getRandomTitles { 27 | NSMutableArray *titles = @[@"红烧螃蟹", @"麻辣龙虾", @"美味苹果", @"胡萝卜", @"清甜葡萄", @"美味西瓜", @"美味香蕉", @"香甜菠萝", @"麻辣干锅", @"剁椒鱼头", @"鸳鸯火锅"].mutableCopy; 28 | NSInteger randomMaxCount = arc4random()%6 + 5; 29 | NSMutableArray *resultArray = [NSMutableArray array]; 30 | for (int i = 0; i < randomMaxCount; i++) { 31 | NSInteger randomIndex = arc4random()%titles.count; 32 | [resultArray addObject:titles[randomIndex]]; 33 | [titles removeObjectAtIndex:randomIndex]; 34 | } 35 | return resultArray; 36 | } 37 | 38 | - (void)reloadData { 39 | 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/LoadDataListBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListBaseViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/28. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LoadDataListBaseViewController : UITableViewController 12 | 13 | @property (nonatomic, strong) UINavigationController *naviController; 14 | @property (nonatomic, copy) void(^didScrollCallback)(UIScrollView *scrollView); 15 | - (void)loadDataForFirst; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | 21 | /** 是否每一次拖拽只发一次请求 */ 22 | @property (assign, nonatomic, getter=isOnlyRefreshPerDrag) BOOL onlyRefreshPerDrag; 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden MJRefreshDeprecated("不建议使用此属性,开发者请自行控制footer的显示和隐藏。基于安全考虑,在未来的某些版本此属性可能作废"); 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | 17 | /** 设置state状态下的文字 */ 18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 19 | 20 | /** 隐藏刷新状态的文字 */ 21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | /** 设置state状态下的文字 */ 17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 18 | 19 | /** 获取state状态下的title */ 20 | - (NSString *)titleForState:(MJRefreshState)state; 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 文字距离圈圈、箭头的距离 */ 20 | @property (assign, nonatomic) CGFloat labelLeftInset; 21 | /** 显示刷新状态的label */ 22 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 23 | /** 设置state状态下的文字 */ 24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "Pull down to refresh"; 2 | "MJRefreshHeaderPullingText" = "Release to refresh"; 3 | "MJRefreshHeaderRefreshingText" = "Loading..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "Tap or pull up to load more"; 6 | "MJRefreshAutoFooterRefreshingText" = "Loading..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "No more data"; 8 | 9 | "MJRefreshBackFooterIdleText" = "Pull up to load more"; 10 | "MJRefreshBackFooterPullingText" = "Release to load more."; 11 | "MJRefreshBackFooterRefreshingText" = "Loading..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "No more data"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "Last updated: "; 15 | "MJRefreshHeaderDateTodayText" = "Today"; 16 | "MJRefreshHeaderNoneLastDateText" = "No record"; 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "下拉可以刷新"; 2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新"; 3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多"; 6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢"; 8 | 9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多"; 10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多"; 11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "最後更新:"; 15 | "MJRefreshHeaderDateTodayText" = "今天"; 16 | "MJRefreshHeaderNoneLastDateText" = "無記錄"; 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (MJRefresh) 12 | + (instancetype)mj_refreshBundle; 13 | + (UIImage *)mj_arrowImage; 14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value; 15 | + (NSString *)mj_localizedStringForKey:(NSString *)key; 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (readonly, nonatomic) UIEdgeInsets mj_inset; 14 | 15 | @property (assign, nonatomic) CGFloat mj_insetT; 16 | @property (assign, nonatomic) CGFloat mj_insetB; 17 | @property (assign, nonatomic) CGFloat mj_insetL; 18 | @property (assign, nonatomic) CGFloat mj_insetR; 19 | 20 | @property (assign, nonatomic) CGFloat mj_offsetX; 21 | @property (assign, nonatomic) CGFloat mj_offsetY; 22 | 23 | @property (assign, nonatomic) CGFloat mj_contentW; 24 | @property (assign, nonatomic) CGFloat mj_contentH; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/刷新数据+UICollectionView封装列表/LoadDataListCollectionListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListCollectionListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/26. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "LoadDataListBaseViewController.h" 10 | #import "JXCategoryListContainerView.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LoadDataListCollectionListViewController : LoadDataListBaseViewController 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/刷新数据+UICollectionView封装列表/LoadDataListCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListCollectionViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/26. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "LoadDataBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// 特殊效果 - 刷新数据+UICollectionView封装列表 14 | @interface LoadDataListCollectionViewController : LoadDataBaseViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/刷新数据+UIScrollView封装列表/LoadDataListContainerListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListContainerListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/19. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "LoadDataListBaseViewController.h" 10 | #import "JXCategoryListContainerView.h" 11 | 12 | @interface LoadDataListContainerListViewController : LoadDataListBaseViewController 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/刷新数据+UIScrollView封装列表/LoadDataListContainerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListContainerViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/12/19. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LoadDataBaseViewController.h" 11 | #import "JXCategoryView.h" 12 | #import "JXCategoryListContainerView.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | /// 特殊效果 - 刷新数据+UIScrollView封装列表 17 | @interface LoadDataListContainerViewController : LoadDataBaseViewController 18 | 19 | @property (nonatomic, strong) JXCategoryTitleView *categoryView; 20 | @property (nonatomic, strong) JXCategoryListContainerView *listContainerView; 21 | @property (nonatomic, strong) NSArray *titles; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Example/Example/Examples/LoadData/刷新数据+列表自定义/LoadDataListCustomViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LoadDataBaseViewController.h" 11 | 12 | /// 特殊效果 - 刷新数据+列表自定义 13 | @interface LoadDataListCustomViewController : LoadDataBaseViewController 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/Nest/NestSubjectViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NestSubjectViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/9/11. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NestSubjectViewController : ContentBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/Nest/NestSubjectViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NestSubjectViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/9/11. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "NestSubjectViewController.h" 10 | #import "JXCategoryTitleView.h" 11 | 12 | @interface NestSubjectViewController () 13 | 14 | @property (nonatomic, strong) JXCategoryTitleView *myCategoryView; 15 | @end 16 | 17 | @implementation NestSubjectViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.myCategoryView.titles = self.titles; 23 | JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc ]init]; 24 | self.myCategoryView.indicators = @[lineView]; 25 | } 26 | 27 | - (JXCategoryTitleView *)myCategoryView { 28 | return (JXCategoryTitleView *)self.categoryView; 29 | } 30 | 31 | - (JXCategoryBaseView *)preferredCategoryView { 32 | return [[JXCategoryTitleView alloc] init]; 33 | } 34 | 35 | #pragma mark - JXCategoryViewDelegate 36 | 37 | - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { 38 | //作为嵌套的子容器,不需要处理侧滑手势处理。示例demo因为是继承,所以直接覆盖掉该代理方法,达到父类不调用下面一行处理侧滑手势的代码。 39 | // self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0); 40 | } 41 | 42 | #pragma mark - JXCategoryListContentViewDelegate 43 | 44 | - (UIView *)listView { 45 | return self.view; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Example/Examples/Nest/NestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NestViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface NestViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Number/NumberViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NumberViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentBaseViewController.h" 11 | 12 | @interface NumberViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/PagingView/PagingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCExampleViewController.h 3 | // JXPagingView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 该库的 JXPagerView 不能保证为最新版本,强烈建议阅读 JXPagingView 库:,里面有更丰富的效果支持!!! 13 | */ 14 | @interface PagingViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/PagingView/PagingViewTableHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PagingViewTableHeaderView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 个人中心,自定义表头视图 12 | @interface PagingViewTableHeaderView : UIView 13 | 14 | - (void)scrollViewDidScroll:(CGFloat)contentOffsetY; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/PagingView/PagingViewTableHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PagingViewTableHeaderView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "PagingViewTableHeaderView.h" 10 | 11 | @interface PagingViewTableHeaderView() 12 | @property (nonatomic, strong) UIImageView *imageView; 13 | @property (nonatomic, assign) CGRect imageViewFrame; 14 | @end 15 | 16 | @implementation PagingViewTableHeaderView 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame 19 | { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | _imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"lufei.jpg"]]; 23 | self.imageView.clipsToBounds = YES; 24 | self.imageView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); 25 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 26 | [self addSubview:self.imageView]; 27 | 28 | self.imageViewFrame = self.imageView.frame; 29 | 30 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, frame.size.height - 30, 200, 30)]; 31 | label.font = [UIFont systemFontOfSize:20]; 32 | label.text = @"Monkey·D·路飞"; 33 | label.textColor = [UIColor redColor]; 34 | [self addSubview:label]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)scrollViewDidScroll:(CGFloat)contentOffsetY { 40 | CGRect frame = self.imageViewFrame; 41 | frame.size.height -= contentOffsetY; 42 | frame.origin.y = contentOffsetY; 43 | self.imageView.frame = frame; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Example/Examples/PagingView/TestListBaseView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestListBaseView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXPagerView.h" 11 | 12 | @interface TestListBaseView : UIView 13 | 14 | @property (nonatomic, strong) UITableView *tableView; 15 | @property (nonatomic, strong) NSArray *dataSource; 16 | @property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView); 17 | - (instancetype)initWithOffsetY:(CGFloat)offsety; 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/Rearrange/RearrangeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RearrangeViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/6/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "LoadDataListContainerViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface RearrangeViewController : LoadDataListContainerViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollUp/ScrollUpListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollUpListViewController.h 3 | // Example 4 | // 5 | // Created by jiaxin on 2020/5/22. 6 | // Copyright © 2020 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface ScrollUpListViewController : UIViewController 15 | @property (nonatomic, copy) void (^scrollViewDidScrollBlock)(UIScrollView *); 16 | @property (nonatomic, copy) void (^willBeginDragging)(UIScrollView *); 17 | @property (nonatomic, copy) void (^didEndDragging)(UIScrollView *); 18 | 19 | - (void)stopScrolling; 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollUp/ScrollUpNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollUpNavigationBar.h 3 | // Example 4 | // 5 | // Created by jiaxin on 2020/5/22. 6 | // Copyright © 2020 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ScrollUpNavigationBar : UIView 14 | @property (nonatomic, copy) void (^backBlock)(void); 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollUp/ScrollUpViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollUpViewController.h 3 | // Example 4 | // 5 | // Created by jiaxin on 2020/5/22. 6 | // Copyright © 2020 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ScrollUpViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollZoom/JXCategoryIndicatorScrollZoomLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorScrollZoomLineView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/9/19. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorLineView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface JXCategoryIndicatorScrollZoomLineView : JXCategoryIndicatorLineView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollZoom/JXCategoryIndicatorScrollZoomLineView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorScrollZoomLineView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/9/19. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorScrollZoomLineView.h" 10 | 11 | @implementation JXCategoryIndicatorScrollZoomLineView 12 | 13 | - (void)jx_refreshState:(JXCategoryIndicatorParamsModel *)model { 14 | //让self.superView的布局更新 15 | [self.superview.superview setNeedsLayout]; 16 | [self.superview.superview layoutIfNeeded]; 17 | [super jx_refreshState:model]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollZoom/LoadDataListScrollZoomViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadDataListScrollZoomViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/7/24. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryView.h" 11 | 12 | @interface LoadDataListScrollZoomViewController : UIViewController 13 | @property (nonatomic, copy) void(^didScrollCallback)(UIScrollView *scrollView); 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/ScrollZoom/ScrollZoomViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollZoomViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/14. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ScrollZoomViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/SegmentedControl/NaviSegmentedControlViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NaviSegmentedControlViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/13. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface NaviSegmentedControlViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/SegmentedControl/SegmentedControlViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SegmentedControlViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentBaseViewController.h" 11 | 12 | @interface SegmentedControlViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/SegmentedControl/SegmentedListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SegmentedListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/13. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SegmentedListViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/SegmentedControl/SegmentedListViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SegmentedListViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/13. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "SegmentedListViewController.h" 10 | #import "SegmentedControlViewController.h" 11 | #import "NaviSegmentedControlViewController.h" 12 | 13 | @interface SegmentedListViewController () 14 | 15 | @end 16 | 17 | @implementation SegmentedListViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.title = @"列表"; 23 | } 24 | 25 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 26 | if (indexPath.row == 0) { 27 | SegmentedControlViewController *segmentedVC = [[SegmentedControlViewController alloc] init]; 28 | [self.navigationController pushViewController:segmentedVC animated:YES]; 29 | }else { 30 | NaviSegmentedControlViewController *segmentedVC = [[NaviSegmentedControlViewController alloc] init]; 31 | [self.navigationController pushViewController:segmentedVC animated:YES]; 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/Example/Examples/Title/TitleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "ContentBaseViewController.h" 10 | 11 | @interface TitleViewController : ContentBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/Title/TitleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "TitleViewController.h" 10 | #import "JXCategoryTitleView.h" 11 | 12 | @interface TitleViewController () 13 | @property (nonatomic, strong) JXCategoryTitleView *myCategoryView; 14 | @end 15 | 16 | @implementation TitleViewController 17 | 18 | - (instancetype)init { 19 | self = [super init]; 20 | if (self) { 21 | self.titles = @[@"螃蟹", @"麻辣小龙虾", @"苹果", @"营养胡萝卜", @"葡萄", @"美味西瓜", @"香蕉", @"香甜菠萝", @"鸡肉", @"鱼", @"海星"]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | self.myCategoryView.titles = self.titles; 30 | } 31 | 32 | - (JXCategoryTitleView *)myCategoryView { 33 | return (JXCategoryTitleView *)self.categoryView; 34 | } 35 | 36 | - (JXCategoryBaseView *)preferredCategoryView { 37 | return [[JXCategoryTitleView alloc] init]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Example/Examples/TitleImage/TitleImageSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TitleImageSettingViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryTitleImageView.h" 11 | 12 | @protocol TitleTitleImageSettingViewControllerDelegate 13 | 14 | - (void)titleImageSettingVCDidSelectedImageType:(JXCategoryTitleImageType)imageType; 15 | 16 | @end 17 | 18 | @interface TitleImageSettingViewController : UITableViewController 19 | 20 | @property (nonatomic, weak) id delegate; 21 | 22 | @property (nonatomic, assign) JXCategoryTitleImageType imageType; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Example/Examples/TitleImage/TitleImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/8. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ContentBaseViewController.h" 11 | 12 | @interface TitleImageViewController : ContentBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/Controller/VerticalListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 特殊效果 - 垂直列表滚动(UICollectionView) 12 | @interface VerticalListViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/Model/VerticalListCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCellModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VerticalListCellModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *imageName; 14 | @property (nonatomic, copy) NSString *itemName; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/Model/VerticalListCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCellModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalListCellModel.h" 10 | 11 | @implementation VerticalListCellModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/Model/VerticalListSectionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListSectionModel.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "VerticalListCellModel.h" 11 | 12 | @interface VerticalListSectionModel : NSObject 13 | 14 | @property (nonatomic, copy) NSString *sectionTitle; 15 | @property (nonatomic, strong) NSArray *cellModels; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/Model/VerticalListSectionModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListSectionModel.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalListSectionModel.h" 10 | 11 | @implementation VerticalListSectionModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalListCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VerticalListCell : UICollectionViewCell 12 | 13 | @property (nonatomic, strong) UILabel *titleLabel; 14 | @property (nonatomic, strong) UIImageView *itemImageView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalListCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCell.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalListCell.h" 10 | 11 | @implementation VerticalListCell 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | self.contentView.backgroundColor = [UIColor whiteColor]; 17 | self.contentView.layer.cornerRadius = 10; 18 | 19 | _titleLabel = [[UILabel alloc] init]; 20 | self.titleLabel.textAlignment = NSTextAlignmentCenter; 21 | [self.contentView addSubview:self.titleLabel]; 22 | 23 | _itemImageView = [[UIImageView alloc] init]; 24 | [self.contentView addSubview:self.itemImageView]; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)layoutSubviews { 30 | [super layoutSubviews]; 31 | 32 | self.itemImageView.bounds = CGRectMake(0, 0, 50, 50); 33 | self.itemImageView.center = CGPointMake(self.bounds.size.width/2, 30); 34 | 35 | self.titleLabel.frame = CGRectMake(0, CGRectGetMaxY(self.itemImageView.frame) + 5, self.bounds.size.width, 30); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalListCollectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCollectionView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/10/10. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface VerticalListCollectionView : UICollectionView 13 | 14 | @property (nonatomic, copy) void(^layoutSubviewsCallback)(void); 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalListCollectionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListCollectionView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/10/10. 6 | // Copyright © 2018 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalListCollectionView.h" 10 | 11 | @implementation VerticalListCollectionView 12 | 13 | - (void)layoutSubviews { 14 | [super layoutSubviews]; 15 | 16 | self.layoutSubviewsCallback(); 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalSectionCategoryHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalSectionCategoryHeaderView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/23. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXCategoryView.h" 11 | 12 | @interface VerticalSectionCategoryHeaderView : UICollectionReusableView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalSectionCategoryHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalSectionCategoryHeaderView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/23. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalSectionCategoryHeaderView.h" 10 | 11 | @implementation VerticalSectionCategoryHeaderView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | self.backgroundColor = [UIColor colorWithRed:0.94 green:0.94 blue:0.94 alpha:1]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalSectionHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalSectionHeaderView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VerticalSectionHeaderView : UICollectionReusableView 12 | 13 | @property (nonatomic, strong) UILabel *titleLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UICollectionView)/View/VerticalSectionHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalSectionHeaderView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/22. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalSectionHeaderView.h" 10 | 11 | @implementation VerticalSectionHeaderView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | self.backgroundColor = [UIColor colorWithRed:0.94 green:0.94 blue:0.94 alpha:1]; 18 | 19 | _titleLabel = [[UILabel alloc] init]; 20 | self.titleLabel.textColor = [UIColor lightGrayColor]; 21 | self.titleLabel.font = [UIFont systemFontOfSize:15]; 22 | [self addSubview:self.titleLabel]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)layoutSubviews { 28 | [super layoutSubviews]; 29 | 30 | [self.titleLabel sizeToFit]; 31 | self.titleLabel.frame = CGRectMake(16, (self.bounds.size.height - self.titleLabel.bounds.size.height)/2, 200, self.titleLabel.bounds.size.height); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/Controller/VerticalListTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListTableViewController.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// 特殊效果 - 垂直列表滚动(UITableView) 14 | @interface VerticalListTableViewController : UIViewController 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalListTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListTableView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface VerticalListTableView : UITableView 14 | @property (nonatomic, copy) void(^layoutSubviewsCallback)(void); 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalListTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalListTableView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalListTableView.h" 10 | 11 | @implementation VerticalListTableView 12 | 13 | - (void)layoutSubviews { 14 | [super layoutSubviews]; 15 | 16 | self.layoutSubviewsCallback(); 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalTableSectionCategoryHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalTableSectionCategoryHeaderView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface VerticalTableSectionCategoryHeaderView : UITableViewHeaderFooterView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalTableSectionCategoryHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalTableSectionCategoryHeaderView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalTableSectionCategoryHeaderView.h" 10 | 11 | @implementation VerticalTableSectionCategoryHeaderView 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalTableSectionHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalTableSectionHeaderView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface VerticalTableSectionHeaderView : UITableViewHeaderFooterView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/Example/Examples/VerticalListView/垂直列表滚动(UITableView)/View/VerticalTableSectionHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticalTableSectionHeaderView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/8/12. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "VerticalTableSectionHeaderView.h" 10 | 11 | @implementation VerticalTableSectionHeaderView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | self.backgroundColor = [UIColor colorWithRed:0.94 green:0.94 blue:0.94 alpha:1]; 17 | 18 | self.textLabel.textColor = [UIColor lightGrayColor]; 19 | self.textLabel.font = [UIFont systemFontOfSize:15]; 20 | } 21 | return self; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/boat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/boat.png -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/city.png -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/light.png -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/lotus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/lotus.png -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/river.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/river.png -------------------------------------------------------------------------------- /Example/Example/Images/Indicator/seaWave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/Indicator/seaWave.png -------------------------------------------------------------------------------- /Example/Example/Images/JXCategoryView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/JXCategoryView.png -------------------------------------------------------------------------------- /Example/Example/Images/JXCategoryViewStructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/JXCategoryViewStructure.png -------------------------------------------------------------------------------- /Example/Example/Images/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/apple.png -------------------------------------------------------------------------------- /Example/Example/Images/apple_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/apple_selected.png -------------------------------------------------------------------------------- /Example/Example/Images/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/arrow_down.png -------------------------------------------------------------------------------- /Example/Example/Images/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/arrow_up.png -------------------------------------------------------------------------------- /Example/Example/Images/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/carrot.png -------------------------------------------------------------------------------- /Example/Example/Images/carrot_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/carrot_selected.png -------------------------------------------------------------------------------- /Example/Example/Images/crab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/crab.png -------------------------------------------------------------------------------- /Example/Example/Images/crab_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/crab_selected.png -------------------------------------------------------------------------------- /Example/Example/Images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/filter.png -------------------------------------------------------------------------------- /Example/Example/Images/football.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/football.png -------------------------------------------------------------------------------- /Example/Example/Images/grape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/grape.png -------------------------------------------------------------------------------- /Example/Example/Images/grape_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/grape_selected.png -------------------------------------------------------------------------------- /Example/Example/Images/lobster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/lobster.png -------------------------------------------------------------------------------- /Example/Example/Images/lobster_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/lobster_selected.png -------------------------------------------------------------------------------- /Example/Example/Images/lufei.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/lufei.jpg -------------------------------------------------------------------------------- /Example/Example/Images/watermelon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/watermelon.png -------------------------------------------------------------------------------- /Example/Example/Images/watermelon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/Example/Example/Images/watermelon_selected.png -------------------------------------------------------------------------------- /Example/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/Example/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // Example 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | #import 16 | 17 | #endif /* PrefixHeader_pch */ 18 | -------------------------------------------------------------------------------- /Example/Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Example 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Example 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | NSString * appDelegateClassName; 14 | @autoreleasepool { 15 | // Setup code that might create autoreleased objects goes here. 16 | appDelegateClassName = NSStringFromClass([AppDelegate class]); 17 | } 18 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 19 | } 20 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'Example' do 4 | pod 'JXCategoryView', :path => '../../JXCategoryView' 5 | pod 'JXPagingView/Pager' 6 | end 7 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JXCategoryView (1.6.1) 3 | - JXPagingView/Pager (2.0.10) 4 | 5 | DEPENDENCIES: 6 | - JXCategoryView (from `../../JXCategoryView`) 7 | - JXPagingView/Pager 8 | 9 | SPEC REPOS: 10 | https://github.com/CocoaPods/Specs.git: 11 | - JXPagingView 12 | 13 | EXTERNAL SOURCES: 14 | JXCategoryView: 15 | :path: "../../JXCategoryView" 16 | 17 | SPEC CHECKSUMS: 18 | JXCategoryView: 7b1ee69ede4843c581688afe84d0f047723262f2 19 | JXPagingView: 7db39b9562d5fac20ac6903e6f3d2fcbc86ae542 20 | 21 | PODFILE CHECKSUM: eeaeae8638778f2993ed7a403b59d48ec34c8611 22 | 23 | COCOAPODS: 1.12.1 24 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryBaseCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryBaseCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryBaseView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryCollectionView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryCollectionView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryDotCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryDotCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryDotView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryFactory.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryFactory.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryImageCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryImageCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorBackgroundView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorBackgroundView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorBallView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorBallView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorComponentView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorDotLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorDotLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorParamsModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryIndicatorParamsModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryIndicatorProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorRainbowLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorRainbowLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorTriangleView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorTriangleView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryIndicatorView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryListContainerRTLCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryListContainerRTLCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryListContainerView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryListContainerView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryNumberCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryNumberCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryNumberView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleImageCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleImageCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleVerticalZoomCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleVerticalZoomCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleVerticalZoomView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryTitleView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/JXCategoryView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryViewAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryViewAnimator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/JXCategoryViewDefines.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryViewDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/RTLManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/RLTManager/RTLManager.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXCategoryView/UIColor+JXAdd.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/UIColor+JXAdd.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXPagingView/JXPagerListContainerView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerListContainerView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXPagingView/JXPagerListRefreshView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerListRefreshView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXPagingView/JXPagerMainTableView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerMainTableView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXPagingView/JXPagerSmoothView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerSmoothView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JXPagingView/JXPagerView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryBaseCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryBaseCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryBaseView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Base/JXCategoryBaseView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryCollectionView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryCollectionView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryDotCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryDotCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryDotView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Dot/JXCategoryDotView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryFactory.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryFactory.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryImageCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryImageCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Image/JXCategoryImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorBackgroundView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorBackgroundView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorBallView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorBallView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorComponentView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorDotLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorDotLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorParamsModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryIndicatorParamsModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryIndicatorProtocol.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorRainbowLineView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorRainbowLineView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorTriangleView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/IndicatorViews/JXCategoryIndicatorTriangleView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryIndicatorView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Indicator/JXCategoryIndicatorView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryListContainerRTLCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryListContainerRTLCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryListContainerView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryListContainerView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryNumberCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryNumberCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryNumberView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Number/JXCategoryNumberView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleImageCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleImageCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleImageView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/TitleImage/JXCategoryTitleImageView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleVerticalZoomCell.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCell.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleVerticalZoomCellModel.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomCellModel.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleVerticalZoomView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryTitleView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Title/JXCategoryTitleView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/JXCategoryView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryViewAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryViewAnimator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/JXCategoryViewDefines.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/JXCategoryViewDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/RTLManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/RLTManager/RTLManager.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXCategoryView/UIColor+JXAdd.h: -------------------------------------------------------------------------------- 1 | ../../../../../Sources/Common/UIColor+JXAdd.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXPagingView/JXPagerListContainerView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerListContainerView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXPagingView/JXPagerListRefreshView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerListRefreshView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXPagingView/JXPagerMainTableView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerMainTableView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXPagingView/JXPagerSmoothView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerSmoothView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JXPagingView/JXPagerView.h: -------------------------------------------------------------------------------- 1 | ../../../JXPagingView/Sources/JXPagerView/JXPagerView.h -------------------------------------------------------------------------------- /Example/Pods/JXPagingView/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 暴走的鑫鑫 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 | -------------------------------------------------------------------------------- /Example/Pods/JXPagingView/Sources/JXPagerView/JXPagerListRefreshView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXPagingListRefreshView.h 3 | // JXPagingView 4 | // 5 | // Created by jiaxin on 2018/8/28. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JXPagerView.h" 11 | 12 | @interface JXPagerListRefreshView : JXPagerView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Pods/JXPagingView/Sources/JXPagerView/JXPagerMainTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXPagingMainTableView.h 3 | // JXPagingView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol JXPagerMainTableViewGestureDelegate 12 | 13 | - (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; 14 | 15 | @end 16 | 17 | @interface JXPagerMainTableView : UITableView 18 | @property (nonatomic, weak) id gestureDelegate; 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/JXPagingView/Sources/JXPagerView/JXPagerMainTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXPagerMainTableView.m 3 | // JXPagerView 4 | // 5 | // Created by jiaxin on 2018/8/27. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXPagerMainTableView.h" 10 | 11 | @interface JXPagerMainTableView () 12 | 13 | @end 14 | 15 | @implementation JXPagerMainTableView 16 | 17 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 18 | if (self.gestureDelegate && [self.gestureDelegate respondsToSelector:@selector(mainTableViewGestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:)]) { 19 | return [self.gestureDelegate mainTableViewGestureRecognizer:gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer]; 20 | }else { 21 | return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]; 22 | } 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/JXCategoryView.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "JXCategoryView", 3 | "version": "1.6.1", 4 | "summary": "A powerful and easy to use category view (segment view, segment control, page view, scroll viewcontroller)", 5 | "homepage": "https://github.com/pujiaxin33/JXCategoryView", 6 | "license": "MIT", 7 | "authors": { 8 | "pujiaxin33": "317437084@qq.com" 9 | }, 10 | "platforms": { 11 | "ios": "9.0" 12 | }, 13 | "source": { 14 | "git": "https://github.com/pujiaxin33/JXCategoryView.git", 15 | "tag": "1.6.1" 16 | }, 17 | "source_files": [ 18 | "Sources", 19 | "Sources/**/*.{h,m}" 20 | ], 21 | "requires_arc": true 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JXCategoryView (1.6.1) 3 | - JXPagingView/Pager (2.0.10) 4 | 5 | DEPENDENCIES: 6 | - JXCategoryView (from `../../JXCategoryView`) 7 | - JXPagingView/Pager 8 | 9 | SPEC REPOS: 10 | https://github.com/CocoaPods/Specs.git: 11 | - JXPagingView 12 | 13 | EXTERNAL SOURCES: 14 | JXCategoryView: 15 | :path: "../../JXCategoryView" 16 | 17 | SPEC CHECKSUMS: 18 | JXCategoryView: 7b1ee69ede4843c581688afe84d0f047723262f2 19 | JXPagingView: 7db39b9562d5fac20ac6903e6f3d2fcbc86ae542 20 | 21 | PODFILE CHECKSUM: eeaeae8638778f2993ed7a403b59d48ec34c8611 22 | 23 | COCOAPODS: 1.12.1 24 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/huqilin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JXCategoryView.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | JXPagingView.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | Pods-Example.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 3 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXCategoryView/JXCategoryView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JXCategoryView : NSObject 3 | @end 4 | @implementation PodsDummy_JXCategoryView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXCategoryView/JXCategoryView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXCategoryView/JXCategoryView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JXCategoryView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JXCategoryView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JXCategoryView" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXPagingView/JXPagingView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JXPagingView : NSObject 3 | @end 4 | @implementation PodsDummy_JXPagingView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXPagingView/JXPagingView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JXPagingView/JXPagingView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JXPagingView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JXPagingView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JXPagingView" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JXPagingView 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JXCategoryView" "${PODS_ROOT}/Headers/Public/JXPagingView" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXCategoryView" "${PODS_CONFIGURATION_BUILD_DIR}/JXPagingView" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"JXCategoryView" -l"JXPagingView" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/JXCategoryView" "${PODS_ROOT}/Headers/Public/JXPagingView" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JXCategoryView" "${PODS_CONFIGURATION_BUILD_DIR}/JXPagingView" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"JXCategoryView" -l"JXPagingView" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /JXCategoryView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint JXCategoryView.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | s.name = "JXCategoryView" 12 | s.version = "1.6.8" 13 | s.summary = "A powerful and easy to use category view (segment view, segment control, page view, scroll viewcontroller) " 14 | s.homepage = "https://github.com/pujiaxin33/JXCategoryView" 15 | s.license = "MIT" 16 | s.author = { "pujiaxin33" => "317437084@qq.com" } 17 | s.platform = :ios, "9.0" 18 | s.source = { :git => "https://github.com/pujiaxin33/JXCategoryView.git", :tag => "#{s.version}" } 19 | s.source_files = "Sources", "Sources/**/*.{h,m}" 20 | s.resource_bundles = {"JXCategoryView" => ["Sources/PrivacyInfo.xcprivacy"]} 21 | s.requires_arc = true 22 | 23 | end 24 | -------------------------------------------------------------------------------- /JXCategoryView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JXCategoryView.xcodeproj/project.xcworkspace/xcuserdata/huqilin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pujiaxin33/JXCategoryView/d2bcedd9f12a4241666b87ad6d85a45395a34a6a/JXCategoryView.xcodeproj/project.xcworkspace/xcuserdata/huqilin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JXCategoryView.xcodeproj/xcuserdata/huqilin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JXCategoryView.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JXCategoryView.xcodeproj/xcuserdata/jiaxin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JXCategoryView.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JXCategoryView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /JXCategoryView/JXCategoryView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/11/22. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for JXCategoryView. 12 | FOUNDATION_EXPORT double JXCategoryViewVersionNumber; 13 | 14 | //! Project version string for JXCategoryView. 15 | FOUNDATION_EXPORT const unsigned char JXCategoryViewVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | 27 | #import 28 | #import 29 | #import 30 | #import 31 | 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 暴走的鑫鑫 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 | -------------------------------------------------------------------------------- /Migration/1.0.0.md: -------------------------------------------------------------------------------- 1 | # 主要更新内容 2 | 3 | 使用POP(面向协议编程)重构指示器视图; 4 | 5 | # API主要更新 6 | 7 | 以`JXCategoryIndicatorLineView`使用为例子: 8 | - 0.0.2版本用法: 9 | ``` 10 | JXCategoryTitleView *categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 100, 300, 30)]; 11 | categoryView.titles = @[@"主题一", @"主题二"]; 12 | categoryView.indicatorLineViewShowEnabled = YES; 13 | categoryView.indicatorLineWidth = 20; 14 | categoryView.indicatorLineViewHeight = 3; 15 | categoryView.indicatorLineViewColor = [UIColor redColor]; 16 | [self.view addSubview:categoryView]; 17 | ``` 18 | 19 | - 1.0.0新版本用法: 20 | ``` 21 | JXCategoryTitleView *categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 100, 300, 30)]; 22 | categoryView.titles = @[@"主题一", @"主题二"]; 23 | 24 | JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; 25 | lineView.indicatorLineWidth = 20; 26 | lineView.indicatorLineViewHeight = 3; 27 | lineView.indicatorLineViewColor = [UIColor redColor]; 28 | categoryView.indicators = @[lineView]; 29 | [self.view addSubview:categoryView]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "JXCategoryView", 8 | platforms: [ 9 | .iOS(.v9) 10 | ], 11 | products: [ 12 | // Products define the executables and libraries a package produces, and make them visible to other packages. 13 | .library( 14 | name: "JXCategoryView", 15 | targets: ["JXCategoryView"]), 16 | ], 17 | dependencies: [ 18 | // Dependencies declare other packages that this package depends on. 19 | // .package(url: /* package url */, from: "1.0.0"), 20 | ], 21 | targets: [ 22 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 23 | // Targets can depend on other targets in this package, and on products in packages this package depends on. 24 | .target( 25 | name: "JXCategoryView", 26 | dependencies: [], 27 | path: "Sources", 28 | resources: [.copy("PrivacyInfo.xcprivacy")] 29 | ), 30 | ] 31 | ) 32 | -------------------------------------------------------------------------------- /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 | 29 | @end 30 | -------------------------------------------------------------------------------- /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 | @property (nonatomic, assign) CGFloat cellWidth; 17 | @property (nonatomic, assign) CGFloat cellSpacing; 18 | @property (nonatomic, assign, getter=isSelected) BOOL selected; 19 | 20 | @property (nonatomic, assign, getter=isCellWidthZoomEnabled) BOOL cellWidthZoomEnabled; 21 | @property (nonatomic, assign) CGFloat cellWidthNormalZoomScale; 22 | @property (nonatomic, assign) CGFloat cellWidthCurrentZoomScale; 23 | @property (nonatomic, assign) CGFloat cellWidthSelectedZoomScale; 24 | 25 | @property (nonatomic, assign, getter=isSelectedAnimationEnabled) BOOL selectedAnimationEnabled; 26 | @property (nonatomic, assign) NSTimeInterval selectedAnimationDuration; 27 | @property (nonatomic, assign) JXCategoryCellSelectedType selectedType; 28 | 29 | @property (nonatomic, assign, getter=isTransitionAnimating) BOOL transitionAnimating; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | @class JXCategoryCollectionView; 12 | 13 | @protocol JXCategoryCollectionViewGestureDelegate 14 | @optional 15 | - (BOOL)categoryCollectionView:(JXCategoryCollectionView *)collectionView gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer; 16 | - (BOOL)categoryCollectionView:(JXCategoryCollectionView *)collectionView gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; 17 | @end 18 | 19 | @interface JXCategoryCollectionView : UICollectionView 20 | 21 | @property (nonatomic, strong) NSArray *> *indicators; 22 | @property (nonatomic, weak) id gestureDelegate; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | /** 14 | 指示器不同情况处理时传递的数据模型,不同情况会对不同的属性赋值,根据不同情况的 api 说明确认。 15 | 16 | FAQ: 为什么会通过 model 传递数据? 17 | 因为指示器处理逻辑以后会扩展不同的使用场景,会新增参数,如果不通过 model 传递,就会在 api 新增参数,一旦修改 api 改的地方就特别多了,而且会影响到之前自定义实现的开发者。 18 | */ 19 | @interface JXCategoryIndicatorParamsModel : NSObject 20 | 21 | @property (nonatomic, assign) NSInteger selectedIndex; // 当前选中的 index 22 | @property (nonatomic, assign) CGRect selectedCellFrame; // 当前选中的 cellFrame 23 | @property (nonatomic, assign) NSInteger leftIndex; // 正在过渡中的两个 cell,相对位置在左边的 cell 的 index 24 | @property (nonatomic, assign) CGRect leftCellFrame; // 正在过渡中的两个 cell,相对位置在左边的 cell 的 frame 25 | @property (nonatomic, assign) NSInteger rightIndex; // 正在过渡中的两个 cell,相对位置在右边的 cell 的 index 26 | @property (nonatomic, assign) CGRect rightCellFrame; // 正在过渡中的两个 cell,相对位置在右边的 cell 的 frame 27 | @property (nonatomic, assign) CGFloat percent; // 正在过渡中的两个 cell,从左到右的百分比 28 | @property (nonatomic, assign) NSInteger lastSelectedIndex; // 之前选中的 index 29 | @property (nonatomic, assign) JXCategoryCellSelectedType selectedType; //cell 被选中类型 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | categoryView 重置状态时调用 18 | 19 | param selectedIndex 当前选中的 index 20 | param selectedCellFrame 当前选中的 cellFrame 21 | @param model 数据模型 22 | */ 23 | - (void)jx_refreshState:(JXCategoryIndicatorParamsModel *)model; 24 | 25 | /** 26 | contentScrollView在进行手势滑动时,处理指示器跟随手势变化UI逻辑; 27 | 28 | param selectedIndex 当前选中的index 29 | param leftIndex 正在过渡中的两个cell,相对位置在左边的cell的index 30 | param leftCellFrame 正在过渡中的两个cell,相对位置在左边的cell的frame 31 | param rightIndex 正在过渡中的两个cell,相对位置在右边的cell的index 32 | param rightCellFrame 正在过渡中的两个cell,相对位置在右边的cell的frame 33 | param percent 过渡百分比 34 | @param model 数据模型 35 | */ 36 | - (void)jx_contentScrollViewDidScroll:(JXCategoryIndicatorParamsModel *)model; 37 | 38 | /** 39 | 选中了某一个cell 40 | 41 | param lastSelectedIndex 之前选中的index 42 | param selectedIndex 选中的index 43 | param selectedCellFrame 选中的cellFrame 44 | param selectedType cell被选中类型 45 | @param model 数据模型 46 | */ 47 | - (void)jx_selectedCell:(JXCategoryIndicatorParamsModel *)model; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Sources/Common/JXCategoryListContainerRTLCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryListContainerRTLCell.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2020/7/3. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface JXCategoryListContainerRTLCell : UICollectionViewCell 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /Sources/Common/JXCategoryListContainerRTLCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryListContainerRTLCell.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2020/7/3. 6 | // 7 | 8 | #import "JXCategoryListContainerRTLCell.h" 9 | #import "RTLManager.h" 10 | 11 | @implementation JXCategoryListContainerRTLCell 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | [RTLManager horizontalFlipViewIfNeeded:self]; 18 | [RTLManager horizontalFlipViewIfNeeded:self.contentView]; 19 | } 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /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 | @interface JXCategoryViewAnimator : NSObject 13 | 14 | @property (nonatomic, assign) NSTimeInterval duration; 15 | @property (nonatomic, copy) void(^progressCallback)(CGFloat percent); 16 | @property (nonatomic, copy) void(^completeCallback)(void); 17 | @property (readonly, getter=isExecuting) BOOL executing; 18 | 19 | - (void)start; 20 | - (void)stop; 21 | - (void)invalid; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /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 | // 指示器的位置 17 | typedef NS_ENUM(NSUInteger, JXCategoryComponentPosition) { 18 | JXCategoryComponentPosition_Bottom, 19 | JXCategoryComponentPosition_Top 20 | }; 21 | 22 | // cell 被选中的类型 23 | typedef NS_ENUM(NSUInteger, JXCategoryCellSelectedType) { 24 | JXCategoryCellSelectedTypeUnknown, // 未知,不是选中(cellForRow方法里面、两个cell过渡时) 25 | JXCategoryCellSelectedTypeClick, // 点击选中 26 | JXCategoryCellSelectedTypeCode, // 调用方法 selectItemAtIndex: 选中 27 | JXCategoryCellSelectedTypeScroll // 通过滚动到某个 cell 选中 28 | }; 29 | 30 | // cell 标题锚点位置 31 | typedef NS_ENUM(NSUInteger, JXCategoryTitleLabelAnchorPointStyle) { 32 | JXCategoryTitleLabelAnchorPointStyleCenter, 33 | JXCategoryTitleLabelAnchorPointStyleTop, 34 | JXCategoryTitleLabelAnchorPointStyleBottom 35 | }; 36 | 37 | // 指示器滚动样式 38 | typedef NS_ENUM(NSUInteger, JXCategoryIndicatorScrollStyle) { 39 | JXCategoryIndicatorScrollStyleSimple, // 简单滚动,即从当前位置过渡到目标位置 40 | JXCategoryIndicatorScrollStyleSameAsUserScroll // 和用户左右滚动列表时的效果一样 41 | }; 42 | 43 | #define JXCategoryViewDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 44 | -------------------------------------------------------------------------------- /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 | @end 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | @property (nonatomic, assign) JXCategoryDotRelativePosition relativePosition; 22 | @property (nonatomic, assign) CGSize dotSize; 23 | @property (nonatomic, assign) CGFloat dotCornerRadius; 24 | @property (nonatomic, strong) UIColor *dotColor; 25 | @property (nonatomic, assign) CGPoint dotOffset; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 红点 x,y方向的偏移 (+值:水平方向向右,竖直方向向下) 27 | */ 28 | @property (nonatomic, assign) CGPoint dotOffset; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Sources/Dot/JXCategoryDotView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryDotView.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2018/8/20. 6 | // Copyright © 2018年 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryDotView.h" 10 | 11 | @implementation JXCategoryDotView 12 | 13 | - (void)initializeData { 14 | [super initializeData]; 15 | 16 | _relativePosition = JXCategoryDotRelativePosition_TopRight; 17 | _dotSize = CGSizeMake(10, 10); 18 | _dotCornerRadius = JXCategoryViewAutomaticDimension; 19 | _dotColor = [UIColor redColor]; 20 | _dotOffset = CGPointZero; 21 | } 22 | 23 | - (Class)preferredCellClass { 24 | return [JXCategoryDotCell class]; 25 | } 26 | 27 | - (void)refreshDataSource { 28 | NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:self.titles.count]; 29 | for (int i = 0; i < self.titles.count; i++) { 30 | JXCategoryDotCellModel *cellModel = [[JXCategoryDotCellModel alloc] init]; 31 | [tempArray addObject:cellModel]; 32 | } 33 | self.dataSource = [NSArray arrayWithArray:tempArray]; 34 | } 35 | 36 | - (void)refreshCellModel:(JXCategoryBaseCellModel *)cellModel index:(NSInteger)index { 37 | [super refreshCellModel:cellModel index:index]; 38 | 39 | JXCategoryDotCellModel *myCellModel = (JXCategoryDotCellModel *)cellModel; 40 | myCellModel.dotHidden = [self.dotStates[index] boolValue]; 41 | myCellModel.relativePosition = self.relativePosition; 42 | myCellModel.dotSize = self.dotSize; 43 | myCellModel.dotColor = self.dotColor; 44 | myCellModel.dotOffset = self.dotOffset; 45 | if (self.dotCornerRadius == JXCategoryViewAutomaticDimension) { 46 | myCellModel.dotCornerRadius = self.dotSize.height/2; 47 | }else { 48 | myCellModel.dotCornerRadius = self.dotCornerRadius; 49 | } 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, strong) id imageInfo; 14 | @property (nonatomic, strong) id selectedImageInfo; 15 | @property (nonatomic, copy) void(^loadImageBlock)(UIImageView *imageView, id info); 16 | 17 | @property (nonatomic, assign) CGSize imageSize; 18 | 19 | @property (nonatomic, assign) CGFloat imageCornerRadius; 20 | 21 | @property (nonatomic, assign, getter=isImageZoomEnabled) BOOL imageZoomEnabled; 22 | 23 | @property (nonatomic, assign) CGFloat imageZoomScale; 24 | 25 | /// 以下属性将会被弃用 26 | @property (nonatomic, copy) NSString *imageName; //加载bundle内的图片 27 | @property (nonatomic, strong) NSURL *imageURL; //图片URL 28 | @property (nonatomic, copy) NSString *selectedImageName; 29 | @property (nonatomic, strong) NSURL *selectedImageURL; 30 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | //imageInfo数组可以传入imageName字符串或者image的URL地址等,然后会通过loadImageBlock透传回来,把imageView对于图片的加载过程完全交给使用者决定。 16 | @property (nonatomic, strong) NSArray *imageInfoArray; 17 | @property (nonatomic, strong) NSArray *selectedImageInfoArray; 18 | @property (nonatomic, copy) void(^loadImageBlock)(UIImageView *imageView, id info); 19 | 20 | @property (nonatomic, assign) CGSize imageSize; //默认值为 CGSizeMake(20, 20) 21 | @property (nonatomic, assign) CGFloat imageCornerRadius; //图片圆角 22 | @property (nonatomic, assign, getter=isImageZoomEnabled) BOOL imageZoomEnabled; //默认值为 NO 23 | @property (nonatomic, assign) CGFloat imageZoomScale; //默认值为 1.2,imageZoomEnabled 为 YES 时才生效 24 | 25 | //下面的属性将会被弃用,请使用`imageInfoArray`、`selectedImageInfoArray`、`loadImageBlock`属性完成需求。 26 | @property (nonatomic, strong) NSArray *imageNames; 27 | @property (nonatomic, strong) NSArray *imageURLs; 28 | @property (nonatomic, strong) NSArray *selectedImageNames; 29 | @property (nonatomic, strong) NSArray *selectedImageURLs; 30 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); //使用imageURL从远端下载图片进行加载,建议使用SDWebImage等第三方库进行下载。 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /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 | /// BackgroundView 样式的指示器 12 | @interface JXCategoryIndicatorBackgroundView : JXCategoryIndicatorComponentView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /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 | /// QQ 小红点样式的指示器 12 | @interface JXCategoryIndicatorBallView : JXCategoryIndicatorComponentView 13 | 14 | // 球沿的 X 轴方向上的偏移量。默认值为 20 15 | @property (nonatomic, assign) CGFloat ballScrollOffsetX; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /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 | /// 点线效果的指示器 12 | @interface JXCategoryIndicatorDotLineView : JXCategoryIndicatorComponentView 13 | 14 | // 线状态的最大宽度,默认值为 50 15 | @property (nonatomic, assign) CGFloat lineWidth; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /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 | 13 | // 指示器图片 14 | @property (nonatomic, strong, readonly) UIImageView *indicatorImageView; 15 | // 图片是否开启滚动,默认值为 NO 16 | @property (nonatomic, assign) BOOL indicatorImageViewRollEnabled; 17 | // 图片的尺寸,默认值为 CGSizeMake(30, 20) 18 | @property (nonatomic, assign) CGSize indicatorImageViewSize; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sources/Indicator/IndicatorViews/JXCategoryIndicatorLineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryIndicatorLineView.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 | typedef NS_ENUM(NSUInteger, JXCategoryIndicatorLineStyle) { 12 | JXCategoryIndicatorLineStyle_Normal = 0, 13 | JXCategoryIndicatorLineStyle_Lengthen = 1, 14 | JXCategoryIndicatorLineStyle_LengthenOffset = 2, 15 | }; 16 | 17 | @interface JXCategoryIndicatorLineView : JXCategoryIndicatorComponentView 18 | 19 | @property (nonatomic, assign) JXCategoryIndicatorLineStyle lineStyle; 20 | 21 | /** 22 | line 滚动时沿 x 轴方向上的偏移量,默认值为 10。 23 | 24 | lineStyle 为 JXCategoryIndicatorLineStyle_LengthenOffset 有用。 25 | */ 26 | @property (nonatomic, assign) CGFloat lineScrollOffsetX; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /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 | 彩虹效果的指示器 15 | 16 | !!!: 会无视 JXCategoryIndicatorLineView 的 indicatorColor 属性,以 indicatorColors 为准。 17 | */ 18 | @interface JXCategoryIndicatorRainbowLineView : JXCategoryIndicatorLineView 19 | 20 | /** 21 | 指示器颜色数组 22 | 23 | 数量需要与 cell 的数量相等。没有提供默认值,必须要赋值该属性。 24 | categoryView 在 reloadData 的时候,也要一并更新该属性,不然会出现数组越界。 25 | */ 26 | @property (nonatomic, strong) NSArray *indicatorColors; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | /// 三角形样式的指示器 12 | @interface JXCategoryIndicatorTriangleView : JXCategoryIndicatorComponentView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Sources/Indicator/JXCategoryIndicatorCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryComponetCell.m 3 | // DQGuess 4 | // 5 | // Created by jiaxin on 2018/7/25. 6 | // Copyright © 2018年 jingbo. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryIndicatorCell.h" 10 | #import "JXCategoryIndicatorCellModel.h" 11 | 12 | @interface JXCategoryIndicatorCell () 13 | @property (nonatomic, strong) UIView *separatorLine; 14 | @end 15 | 16 | @implementation JXCategoryIndicatorCell 17 | 18 | - (void)initializeViews { 19 | [super initializeViews]; 20 | 21 | self.separatorLine = [[UIView alloc] init]; 22 | self.separatorLine.hidden = YES; 23 | [self.contentView addSubview:self.separatorLine]; 24 | } 25 | 26 | - (void)layoutSubviews { 27 | [super layoutSubviews]; 28 | 29 | JXCategoryIndicatorCellModel *model = (JXCategoryIndicatorCellModel *)self.cellModel; 30 | CGFloat lineWidth = model.separatorLineSize.width; 31 | CGFloat lineHeight = model.separatorLineSize.height; 32 | 33 | self.separatorLine.frame = CGRectMake(self.bounds.size.width - lineWidth + self.cellModel.cellSpacing/2, (self.bounds.size.height - lineHeight)/2.0, lineWidth, lineHeight); 34 | } 35 | 36 | - (void)reloadData:(JXCategoryBaseCellModel *)cellModel { 37 | [super reloadData:cellModel]; 38 | 39 | JXCategoryIndicatorCellModel *model = (JXCategoryIndicatorCellModel *)cellModel; 40 | self.separatorLine.backgroundColor = model.separatorLineColor; 41 | self.separatorLine.hidden = !model.isSepratorLineShowEnabled; 42 | 43 | if (model.isCellBackgroundColorGradientEnabled) { 44 | if (model.isSelected) { 45 | self.contentView.backgroundColor = model.cellBackgroundSelectedColor; 46 | }else { 47 | self.contentView.backgroundColor = model.cellBackgroundUnselectedColor; 48 | } 49 | } 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /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, getter=isSepratorLineShowEnabled) BOOL sepratorLineShowEnabled; 15 | @property (nonatomic, strong) UIColor *separatorLineColor; 16 | @property (nonatomic, assign) CGSize separatorLineSize; 17 | 18 | @property (nonatomic, assign) CGRect backgroundViewMaskFrame; // 底部指示器的 frame 转换到 cell 的 frame 19 | 20 | @property (nonatomic, assign, getter=isCellBackgroundColorGradientEnabled) BOOL cellBackgroundColorGradientEnabled; 21 | @property (nonatomic, strong) UIColor *cellBackgroundSelectedColor; 22 | @property (nonatomic, strong) UIColor *cellBackgroundUnselectedColor; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, assign, readonly) CGFloat numberStringWidth; 16 | @property (nonatomic, copy) void(^numberStringFormatterBlock)(NSInteger number); 17 | @property (nonatomic, strong) UIColor *numberBackgroundColor; 18 | @property (nonatomic, strong) UIColor *numberTitleColor; 19 | @property (nonatomic, assign) CGFloat numberLabelWidthIncrement; 20 | @property (nonatomic, assign) CGFloat numberLabelHeight; 21 | @property (nonatomic, strong) UIFont *numberLabelFont; 22 | @property (nonatomic, assign) CGPoint numberLabelOffset; 23 | @property (nonatomic, assign) BOOL shouldMakeRoundWhenSingleNumber; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /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 | - (void)setNumberString:(NSString *)numberString { 14 | _numberString = numberString; 15 | 16 | [self updateNumberSizeWidthIfNeeded]; 17 | } 18 | 19 | - (void)setNumberLabelHeight:(CGFloat)numberLabelHeight { 20 | _numberLabelHeight = numberLabelHeight; 21 | 22 | [self updateNumberSizeWidthIfNeeded]; 23 | } 24 | 25 | - (void)setNumberLabelFont:(UIFont *)numberLabelFont { 26 | _numberLabelFont = numberLabelFont; 27 | 28 | [self updateNumberSizeWidthIfNeeded]; 29 | } 30 | 31 | - (void)updateNumberSizeWidthIfNeeded { 32 | if (self.numberLabelFont != nil) { 33 | _numberStringWidth = [self.numberString boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, self.numberLabelHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : self.numberLabelFont} context:nil].size.width; 34 | } 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /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 | /** 51 | numberLabel x,y方向的偏移 (+值:水平方向向右,竖直方向向下) 52 | */ 53 | @property (nonatomic, assign) CGPoint numberLabelOffset; 54 | 55 | /** 56 | 当是单一数字时,是否让numberLabel变成圆。即numberLabel的宽度等于高度,cornerRadius等于高度/2。当为true,单一数字时会忽略numberLabelWidthIncrement属性。默认为NO; 57 | */ 58 | @property (nonatomic, assign) BOOL shouldMakeRoundWhenSingleNumber; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Sources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | NSPrivacyTrackingDomains 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyTracking 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Sources/RLTManager/RTLManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTLManager.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2020/7/3. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface RTLManager : NSObject 13 | 14 | + (BOOL)supportRTL; 15 | + (void)horizontalFlipView:(UIView *)view; 16 | + (void)horizontalFlipViewIfNeeded:(UIView *)view; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Sources/RLTManager/RTLManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTLManager.m 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2020/7/3. 6 | // 7 | 8 | #import "RTLManager.h" 9 | 10 | @implementation RTLManager 11 | 12 | + (BOOL)supportRTL { 13 | return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UIView.appearance.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft; 14 | } 15 | 16 | + (void)horizontalFlipView:(UIView *)view { 17 | view.transform = CGAffineTransformMakeScale(-1, 1); 18 | } 19 | 20 | + (void)horizontalFlipViewIfNeeded:(UIView *)view { 21 | if ([self supportRTL]) { 22 | [self horizontalFlipView:view]; 23 | } 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /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 | @property (nonatomic, strong) UILabel *maskTitleLabel; 17 | @property (nonatomic, strong) NSLayoutConstraint *titleLabelCenterX; 18 | @property (nonatomic, strong) NSLayoutConstraint *titleLabelCenterY; 19 | @property (nonatomic, strong) NSLayoutConstraint *maskTitleLabelCenterX; 20 | 21 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleZoomAnimationBlock:(JXCategoryTitleCellModel *)cellModel baseScale:(CGFloat)baseScale; 22 | 23 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleStrokeWidthAnimationBlock:(JXCategoryTitleCellModel *)cellModel attributedString:(NSMutableAttributedString *)attributedString; 24 | 25 | - (JXCategoryCellSelectedAnimationBlock)preferredTitleColorAnimationBlock:(JXCategoryTitleCellModel *)cellModel; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /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 | - (void)setTitle:(NSString *)title { 14 | _title = title; 15 | 16 | [self updateNumberSizeWidthIfNeeded]; 17 | } 18 | 19 | - (void)setTitleFont:(UIFont *)titleFont { 20 | _titleFont = titleFont; 21 | 22 | [self updateNumberSizeWidthIfNeeded]; 23 | } 24 | 25 | - (void)updateNumberSizeWidthIfNeeded { 26 | if (self.titleFont) { 27 | _titleHeight = [self.title boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : self.titleFont} context:nil].size.height; 28 | } 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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, strong) id imageInfo; 25 | @property (nonatomic, strong) id selectedImageInfo; 26 | @property (nonatomic, copy) void(^loadImageBlock)(UIImageView *imageView, id info); 27 | 28 | @property (nonatomic, assign) CGSize imageSize; //默认CGSizeMake(20, 20) 29 | 30 | @property (nonatomic, assign) CGFloat titleImageSpacing; //titleLabel和ImageView的间距,默认5 31 | 32 | @property (nonatomic, assign, getter=isImageZoomEnabled) BOOL imageZoomEnabled; 33 | 34 | @property (nonatomic, assign) CGFloat imageZoomScale; 35 | 36 | /// 以下属性将会被弃用 37 | @property (nonatomic, copy) NSString *imageName; //加载bundle内的图片 38 | @property (nonatomic, strong) NSURL *imageURL; //图片URL 39 | @property (nonatomic, copy) NSString *selectedImageName; 40 | @property (nonatomic, strong) NSURL *selectedImageURL; 41 | @property (nonatomic, copy) void(^loadImageCallback)(UIImageView *imageView, NSURL *imageURL); 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Sources/VerticalZoomTitle/JXCategoryTitleVerticalZoomView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JXCategoryTitleVerticalZoomView.h 3 | // JXCategoryView 4 | // 5 | // Created by jiaxin on 2019/2/14. 6 | // Copyright © 2019 jiaxin. All rights reserved. 7 | // 8 | 9 | #import "JXCategoryTitleView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /** 14 | 垂直方向的缩放值范围:minVerticalFontScale~maxVerticalFontScale; 15 | 垂直方向cellSpacing范围:minVerticalCellSpacing~maxVerticalCellSpacing,用于达到缩小时cell更加紧凑 16 | 根据UI设计师给你的参数,去多次尝试设置上面的值来达到同样的效果。多尝试几次就知道每个属性设置之后的效果。 17 | */ 18 | @interface JXCategoryTitleVerticalZoomView : JXCategoryTitleView 19 | 20 | @property (nonatomic, assign) CGFloat maxVerticalFontScale; //垂直方向最大的缩放值 21 | @property (nonatomic, assign) CGFloat minVerticalFontScale; //垂直方向最小的缩放值 22 | @property (nonatomic, assign) CGFloat maxVerticalCellSpacing; //垂直方向最大的cellSpacing 23 | @property (nonatomic, assign) CGFloat minVerticalCellSpacing; //垂直方向最小的cellSpacing 24 | 25 | /** 26 | 当前列表滚动时,根据当前垂直方向categoryView高度变化的百分比,刷新布局 27 | 28 | @param percent 当前垂直方向categoryView高度变化百分比 29 | */ 30 | - (void)listDidScrollWithVerticalHeightPercent:(CGFloat)percent; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Tests/JXCategoryViewTests/JXCategoryViewTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import JXCategoryView 3 | 4 | final class JXCategoryViewTests: XCTestCase { 5 | func testExample() { 6 | // This is an example of a functional test case. 7 | // Use XCTAssert and related functions to verify your tests produce the correct 8 | // results. 9 | XCTAssertEqual(JXCategoryView().text, "Hello, World!") 10 | } 11 | 12 | static var allTests = [ 13 | ("testExample", testExample), 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /Tests/JXCategoryViewTests/XCTestManifests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | #if !canImport(ObjectiveC) 4 | public func allTests() -> [XCTestCaseEntry] { 5 | return [ 6 | testCase(JXCategoryViewTests.allTests), 7 | ] 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import JXCategoryViewTests 4 | 5 | var tests = [XCTestCaseEntry]() 6 | tests += JXCategoryViewTests.allTests() 7 | XCTMain(tests) 8 | --------------------------------------------------------------------------------