Zurück zum Ranking

12207480/TYCyclePagerView

Objective-C

a simple and usefull cycle pager view ,and auto scroll banner view(轮播图) ,include pageControl for iOS,support Objective-C and swift

pagercyclebannerautoscrollingpagecontrol
Sterne-Wachstum
Sterne
1.8k
Forks
334
Wochenwachstum
Issues
26
5001k1.5k
Jan. 2023März 2024Mai 2025Juli 2026
README

TYCyclePagerView

a simple and usefull cycle pager view ,and auto scroll banner view ,include pageControl for iOS,support Objective-C and swift.this has been used in APP.

CocoaPods

pod 'TYCyclePagerView'

Carthage

github "12207480/TYCyclePagerView"

Requirements

  • Xcode 8 or higher
  • iOS 7.0 or higher
  • ARC

ScreenShot

image

API

  • DataSource and Delegate

@protocol TYCyclePagerViewDataSource <NSObject>

- (NSInteger)numberOfItemsInPagerView:(TYCyclePagerView *)pageView;

- (__kindof UICollectionViewCell *)pagerView:(TYCyclePagerView *)pagerView cellForItemAtIndex:(NSInteger)index;

/**
 return pagerView layout,and cache layout
 */
- (TYCyclePagerViewLayout *)layoutForPagerView:(TYCyclePagerView *)pageView;

@protocol TYCyclePagerViewDelegate <NSObject>

@optional

/**
 pagerView did scroll to new index page
 */
- (void)pagerView:(TYCyclePagerView *)pageView didScrollFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;

/**
 pagerView did selected item cell
 */
- (void)pagerView:(TYCyclePagerView *)pageView didSelectedItemCell:(__kindof UICollectionViewCell *)cell atIndex:(NSInteger)index;

// More API see project
  • Class

@interface TYCyclePagerView : UIView

// will be automatically resized to track the size of the pagerView
@property (nonatomic, strong, nullable) UIView *backgroundView; 

@property (nonatomic, weak, nullable) id<TYCyclePagerViewDataSource> dataSource;
@property (nonatomic, weak, nullable) id<TYCyclePagerViewDelegate> delegate;

// pager view layout is important
@property (nonatomic, strong, readonly) TYCyclePagerViewLayout *layout;

/**
 is infinite cycle pageview
 */
@property (nonatomic, assign) BOOL isInfiniteLoop;

/**
 pagerView automatic scroll time interval, default 0,disable automatic
 */
@property (nonatomic, assign) CGFloat autoScrollInterval;


@interface TYCyclePagerViewLayout : NSObject

@property (nonatomic, assign) CGSize itemSize;
@property (nonatomic, assign) CGFloat itemSpacing;
@property (nonatomic, assign) UIEdgeInsets sectionInset;

@property (nonatomic, assign) TYCyclePagerTransformLayoutType layoutType;

@property (nonatomic, assign) CGFloat minimumScale; // sacle default 0.8
@property (nonatomic, assign) CGFloat minimumAlpha; // alpha default 1.0
@property (nonatomic, assign) CGFloat maximumAngle; // angle is % default 0.2


@interface TYPageControl : UIControl

@property (nonatomic, assign) NSInteger numberOfPages;          // default is 0
@property (nonatomic, assign) NSInteger currentPage;            // default is 0. value pinned to 0..numberOfPages-1

// indicatorTint color
@property (nullable, nonatomic,strong) UIColor *pageIndicatorTintColor;
@property (nullable, nonatomic,strong) UIColor *currentPageIndicatorTintColor;

// indicator image
@property (nullable, nonatomic,strong) UIImage *pageIndicatorImage;
@property (nullable, nonatomic,strong) UIImage *currentPageIndicatorImage;

Usage


- (void)addPagerView {
    TYCyclePagerView *pagerView = [[TYCyclePagerView alloc]init];
    pagerView.layer.borderWidth = 1;
    pagerView.isInfiniteLoop = YES;
    pagerView.autoScrollInterval = 3.0;
    pagerView.dataSource = self;
    pagerView.delegate = self;
    // registerClass or registerNib
    [pagerView registerClass:[TYCyclePagerViewCell class] forCellWithReuseIdentifier:@"cellId"];
    [self.view addSubview:pagerView];
    _pagerView = pagerView;
}

- (void)addPageControl {
    TYPageControl *pageControl = [[TYPageControl alloc]init];
    //pageControl.numberOfPages = _datas.count;
    pageControl.currentPageIndicatorSize = CGSizeMake(8, 8);
//    pageControl.pageIndicatorImage = [UIImage imageNamed:@"Dot"];
//    pageControl.currentPageIndicatorImage = [UIImage imageNamed:@"DotSelected"];
//    [pageControl addTarget:self action:@selector(pageControlValueChangeAction:) forControlEvents:UIControlEventValueChanged];
    [_pagerView addSubview:pageControl];
    _pageControl = pageControl;
}
- (void)loadData {
    // load data to _datas
    _pageControl.numberOfPages = _datas.count;
    [_pagerView reloadData];
}

Contact

如果你发现bug,please pull reqeust me
如果你有更好的改进,please pull reqeust me

License

TYCyclePagerView is released under the MIT license. See LICENSE for details.

Ähnliche Repositories
dandavison/delta

A syntax-highlighting pager for git, diff, grep, rg --json, and blame output

Rustcrates.ioMIT Licensegitdiff
dandavison.github.io/delta/
31.5k552
tstack/lnav

Log file navigator

C++BSD 2-Clause "Simplified" Licenselog-analysislog-monitor
lnav.org
10.5k391
x-extends/vxe-table

vxe table 支持 vue2, vue3 的表格解决方案

TypeScriptnpmMIT Licensevxe-tablevue
vxetable.cn
8.6k1.1k
ChiliLabs/CHIPageControl

A set of cool animated page controls written in Swift to replace boring UIPageControl. Mady by @ChiliLabs - https://chililabs.io

SwiftMIT Licenseswiftswift3
3.5k263
okbob/pspg

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

CBSD 2-Clause "Simplified" Licensecncurses
2.7k88
Mottie/tablesorter

Github fork of Christian Bach's tablesorter plugin + awesomeness ~

JavaScriptnpmtablesorterpager
mottie.github.io/tablesorter/docs/
2.6k748
noborus/ov

🎑Feature-rich terminal-based text viewer. It is a so-called terminal pager.

GoGo ModulesMIT Licensepagergo
noborus.github.io/ov
2k45
fermoya/SwiftUIPager

Native Pager in SwiftUI

SwiftMIT Licenseswiftuiios
1.5k197
12207480/TYPagerController

page scroll view and controller,simple,high custom,and have many tabBar styles,,support Objective-C and swift

Objective-CMIT Licensepager-controllerpager
1.4k228
walles/moor

Moor is a pager. It's designed to just do the right thing without any configuration.

GoGo ModulesOtherpagermoar
1.1k58