{"id":2192,"url":"https://github.com/WenchaoD/FSPagerView","last_synced_at":"2025-08-06T16:31:45.426Z","repository":{"id":37359227,"uuid":"81572885","full_name":"WenchaoD/FSPagerView","owner":"WenchaoD","description":"FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.","archived":false,"fork":false,"pushed_at":"2024-06-29T17:34:52.000Z","size":2105,"stargazers_count":7216,"open_issues_count":177,"forks_count":980,"subscribers_count":105,"default_branch":"master","last_synced_at":"2024-12-02T18:56:00.559Z","etag":null,"topics":["banner","banner-slider","banner-view","infinite-scroll","ios","objective-c","pages","swift","uicollectionview","uicollectionviewlayout"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WenchaoD.png","metadata":{"files":{"readme":"README-OBJECTIVE-C.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-10T14:28:37.000Z","updated_at":"2024-12-02T09:23:31.000Z","dependencies_parsed_at":"2024-04-27T23:32:13.366Z","dependency_job_id":"0f9f139a-6b9e-420f-97f5-9cd50322058a","html_url":"https://github.com/WenchaoD/FSPagerView","commit_stats":{"total_commits":118,"total_committers":10,"mean_commits":11.8,"dds":0.09322033898305082,"last_synced_commit":"968f0aaf120b8cb97d12c3a4447daa4926029f67"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSPagerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSPagerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSPagerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSPagerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WenchaoD","download_url":"https://codeload.github.com/WenchaoD/FSPagerView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227981926,"owners_count":17850918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banner","banner-slider","banner-view","infinite-scroll","ios","objective-c","pages","swift","uicollectionview","uicollectionviewlayout"],"created_at":"2024-01-05T20:16:07.172Z","updated_at":"2024-12-09T16:31:10.306Z","avatar_url":"https://github.com/WenchaoD.png","language":"Swift","readme":"![fspagerview](https://cloud.githubusercontent.com/assets/5186464/24086370/45e7e8dc-0d49-11e7-86aa-139354fe00c5.jpg)\n\n[![Languages](https://img.shields.io/badge/language-swift%204.2%20|%20objc-FF69B4.svg?style=plastic)](#) \u003cbr/\u003e\n[![Platform](https://img.shields.io/badge/platform-iOS%20|%20tvOS-blue.svg?style=plastic)](http://cocoadocs.org/docsets/FSPagerView) \n[![Version](https://img.shields.io/cocoapods/v/FSPagerView.svg?style=flat)](http://cocoadocs.org/docsets/FSPagerView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=plastic)](https://github.com/Carthage/Carthage)\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-FF9966.svg?style=plastic)](https://swift.org/package-manager/)\n\n|[\u003cb\u003eSWIFT\u003c/b\u003e](https://github.com/WenchaoD/FSPagerView/blob/master/README.md)|\u003cb\u003eOBJECTIVE-C\u003c/b\u003e|\n|---|---|\n\n**FSPagerView** is an elegant Screen Slide Library implemented primarily with ***UICollectionView***. It is extremely helpful for making Banner、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.\n\n## Features\n*  ***Infinite*** scrolling.\n*  ***Automatic*** Sliding.\n*  Support ***Horizontal*** and ***Vertical*** paging.\n*  Fully customizable item, with predefined banner-style item.\n*  Fully customizable ***page control***.\n*  Rich build-in 3D transformers.\n*  ***Simple*** and ***Delightful*** api usage.\n*  Support **SWIFT** and **OBJECTIVE-C**.\n\n## Demo1 Banner\n\n| Banner |\n|---|\n|![9](https://cloud.githubusercontent.com/assets/5186464/22688057/9003d880-ed65-11e6-882e-4587c97c8878.gif) |\n\n### automaticSlidingInterval\nThe time interval of automatic sliding. 0 means disabling automatic sliding. Default is 0.\n\n**e.g.**\n\n```objc\npagerView.automaticSlidingInterval = 3.0;\n```\n\n\n### isInfinite\nA boolean value indicates whether the pager view has infinite number of items. Default is false.\n\n**e.g.**\n\n```objc\npagerView.isInfinite = YES;\n```\n\n### decelerationDistance\nAn unsigned integer value that determines the paging distance of the pager view, which indicates the number of passing items during the deceleration. When the value of this property is FSPagerViewAutomaticDistance, the actual 'distance' is automatically calculated according to the scrolling speed of the pager view. Default is 1.\n\n**e.g.**\n\n```objc\npagerView.decelerationDistance = 2\n```\n\n### itemSize\nThe item size of the pager view. When the value of this property is FSPagerViewAutomaticSize, the items fill the entire visible area of the pager view. Default is FSPagerViewAutomaticSize.\n\n\n**e.g.**\n\n```objc\npagerView.itemSize = CGSizeMake(200, 180);\n```\n\n### interitemSpacing\nThe spacing to use between items in the pager view. Default is 0.\n\n**e.g.**\n\n```objc\npagerView.interitemSpacing = 10;\n```\n\n## Demo2 - Transformers\n\n|Cross Fading|\n|---|\n| ![1](https://cloud.githubusercontent.com/assets/5186464/22686429/1983b97e-ed5f-11e6-9a32-44c1830df7ac.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeCrossFading];\n```\n---\n\n\n\n|Zoom Out|\n|---|\n| ![2](https://cloud.githubusercontent.com/assets/5186464/22686426/19830862-ed5f-11e6-90be-8fb1319cd125.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeZoomOut];\n```\n---\n\n\n|Depth|\n|---|\n| ![3](https://cloud.githubusercontent.com/assets/5186464/22686430/19856c1a-ed5f-11e6-8187-9e4395b7597c.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeDepth];\n```\n---\n\n\n|Linear|\n|---|\n| ![4](https://cloud.githubusercontent.com/assets/5186464/22686428/198368c0-ed5f-11e6-95df-cfcfe9bc3f29.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeLinear];\n```\n---\n\n\n|Overlap|\n|---|\n| ![5](https://cloud.githubusercontent.com/assets/5186464/22686431/198905aa-ed5f-11e6-9312-ec371c8c4e44.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeOverlap];\n```\n---\n\n\n|Ferris Wheel|\n|------|\n| ![6](https://cloud.githubusercontent.com/assets/5186464/22686427/19831c08-ed5f-11e6-8bdb-30e762a85d4b.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeFerrisWheel];\n```\n---\n\n\n|Inverted Ferris Wheel|\n|------|\n| ![7](https://cloud.githubusercontent.com/assets/5186464/22686433/19b669a0-ed5f-11e6-8bf0-dc23edf8101f.gif) |\n\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeInvertedFerrisWheel];\n```\n---\n\n\n|Cover Flow|\n|------|\n| ![8](https://cloud.githubusercontent.com/assets/5186464/22686432/19b567f8-ed5f-11e6-885d-bd660c98b507.gif) |\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeCoverFlow];\n```\n---\n\n|Cubic|\n|------|\n| ![9](https://cloud.githubusercontent.com/assets/5186464/23461598/8875080c-fec5-11e6-8db6-6d8864acfcc1.gif) |\n```objc\npagerView.transformer = [[FSPagerViewTransformer alloc] initWithType:FSPagerViewTransformerTypeCubic];\n```\n---\n\n\n\u003e Customize your own transformer by subclassing`FSPagerViewTransformer.`\n\n\n## Demo3 Page Control\n|Page Control|\n|---|\n|![10](https://cloud.githubusercontent.com/assets/5186464/22689720/2baabdb0-ed6d-11e6-8287-ef7a2c0f64bc.gif)\n|\n\n### numberOfPages\nThe number of page indicators of the page control. Default is 0.\n\n**e.g.**\n\n```objc\npageControl.numberOfPages = 5;\n```\n\n### currentPage\nThe current page, highlighted by the page control. Default is 0.\n\n**e.g.**\n\n```objc\npageControl.currentPage = 1;\n```\n### contentHorizontalAlignment\nThe horizontal alignment of content within the control’s bounds. Default is center.\n\n**e.g.**\n\n```objc\npageControl.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;\n```\n\n### setStrokeColor:forState:\nSets the stroke color for page indicators to use for the specified state. (selected/normal).\n\n**e.g.**\n\n```objc\n[pageControl setStrokeColor:[UIColor greenColor] forState:UIControlStateNormal];\n[pageControl setStrokeColor:[UIColor yellowColor] forState:UIControlStateSelected];\n```\n\n\n### setFillColor:forState:\nSets the fill color for page indicators to use for the specified state. (selected/normal).\n\n**e.g.**\n\n```objc\n[pageControl setFillColor:[UIColor grayColor] forState:UIControlStateNormal];\n[pageControl setFillColor:[UIColor whiteColor] forState:UIControlStateSelected];\n```\n\n### setImage:forState:\nSets the image for page indicators to use for the specified state. (selected/normal).\n\n**e.g.**\n\n```objc\n[pageControl setImage:[UIImage imageNamed:@\"image1\"] forState:UIControlStateNormal];\n[pageControl setImage:[UIImage imageNamed:@\"image2\"] forState:UIControlStateSelected];\n```\n\n### setPath:forState:\nSets the path for page indicators to use for the specified state. (selected/normal).\n\n**e.g.**\n\n```objc\n[pageControl setPath:[UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 8, 8)] forState:UIControlStateNormal];\n[pageControl setPath: [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, 8, 8)]  forState:UIControlStateSelected];\n```\n\n## Installation\n* Manually\n* Cocoapods\n* Carthage\n\n### Manually\n1. ***[Download](#)*** the source code.\n2. Extract the zip file, simply drag folder ***Sources*** into your project.\n3. Make sure ***Copy items if needed*** is checked.\n\n### Cocoapods\n```ruby\nuse_frameworks!\ntarget '\u003cYour Target Name\u003e' do\n    pod 'FSPagerView'\nend\n```\n\n### Carthage\n```ruby\ngithub \"WenchaoD/FSPagerView\"\n```\n\n## Tutorial\n* [Getting started](#getting_started)\n* [Implement FSPagerViewDataSource](#implement_fspagerviewdatasource)\n* [Implement FSPagerViewDelegate](#implement_fspagerviewdelegate)\n\n### 1. Getting started \u003ca id='getting_started'\u003e\u003c/a\u003e\n\n* Getting started with code\n\n```objc\n// Create a pager view\nFSPagerView *pagerView = [[FSPagerView alloc] initWithFrame:frame1];\npagerView.dataSource = self;\npagerView.delegate = self;\n[pagerView registerClass:[FSPagerViewCell class] forCellWithReuseIdentifier:@\"cell\"];\n[self.view addSubview:pagerView];\n// Create a page control\nFSPageControl *pageControl = [[FSPageControl alloc] initWithFrame:frame2];\n[self.view addSubview:pageControl];\n```\n\n* Getting started with Interface Builder \u003cbr/\u003e\n1、Simply drag **UIView** instance into your View Controller, Change the `Custom Class` to `FSPagerView`. (Or `FSPageControl`) \u003cbr/\u003e\n2、Link the `dataSource` and `delegate` property of **FSPagerView** to your View Controller. \u003cbr/\u003e\n3、Register a cell class.\n\n```objc\n- (void)viewDidLoad \n{\n\t[super viewDidLoad];\n\t[self.pagerView registerClass:[FSPagerViewCell class] forCellWithReuseIdentifier:@\"cell\"];\n}\n```\n\n\n### 2. Implement FSPagerViewDataSource \u003ca id='implement_fspagerviewdatasource'\u003e\u003c/a\u003e\n```objc\n- (NSInteger)numberOfItemsInpagerView:(FSPagerView *)pagerView\n{\n    return numberOfItems;\n}\n    \n- (FSPagerViewCell *)pagerView:(FSPagerView *)pagerView cellForItemAtIndex:(NSInteger)index\n{\n    FSPagerViewCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@\"cell\" atIndex:index];\n    cell.imageView.image = ...;\n    cell.textLabel.text = ...;\n    return cell;\n}\n```\n\n### 3. Implement FSPagerViewDelegate \u003ca id='implement_fspagerviewdelegate'\u003e\u003c/a\u003e\n\n```objc\n- (BOOL)pagerView:(FSPagerView *)pagerView shouldHighlightItemAtIndex:(NSInteger)index;\n```\n\u003e Asks the delegate if the item should be highlighted during tracking.\n\n---\n\n```objc\n- (void)pagerView:(FSPagerView *)pagerView didHighlightItemAtIndex:(NSInteger)index;\n```\n\u003e Tells the delegate that the item at the specified index was highlighted.\n    \n---\n    \n```objc\n- (BOOL)pagerView:(FSPagerView *)pagerView shouldSelectItemAtIndex:(NSInteger)index;\n```\n\u003e Asks the delegate if the specified item should be selected.\n    \n---\n    \n```objc\n- (void)pagerView:(FSPagerView *)pagerView didSelectItemAtIndex:(NSInteger)index;\n```\n\u003e Tells the delegate that the item at the specified index was selected.\n    \n---\n    \n```objc\n- (void)pagerView:(FSPagerView *)pagerView willDisplayCell:(FSPagerViewCell *)cell forItemAtIndex:(NSInteger)index;\n```\n\u003e Tells the delegate that the specified cell is about to be displayed in the pager view.\n    \n---\n    \n```objc\n- (void)pagerView:(FSPagerView *)pagerView didEndDisplayingCell:(FSPagerViewCell *)cell forItemAtIndex:(NSInteger)index;\n```\n\u003e Tells the delegate that the specified cell was removed from the pager view.\n    \n---\n    \n```objc\n- (void)pagerViewWillBeginDragging:(FSPagerView *)pagerView;\n```\n\u003e Tells the delegate when the pager view is about to start scrolling the content.\n    \n---\n    \n```objc\n- (void)pagerViewWillEndDragging:(FSPagerView *) pagerView targetIndex:(NSInteger)index:\n```\n\u003e Tells the delegate when the user finishes scrolling the content.\n    \n---\n    \n```objc\n- (void)pagerViewDidScroll:(FSPagerView *)pagerView;\n```\n\u003e Tells the delegate when the user scrolls the content view within the receiver.\n    \n---\n    \n```objc\n- (void)pagerViewDidEndScrollAnimation:(FSPagerView *)pagerView;\n```\n\u003e Tells the delegate when a scrolling animation in the pager view concludes.\n    \n---\n    \n```objc\n- (void)pagerViewDidEndDecelerating:(FSPagerView *)pagerView;\n```\n\u003e Tells the delegate that the pager view has ended decelerating the scrolling movement.\n\n---\n\n## \u003ca id=\"support\"\u003e\u003c/a\u003eSupport this repo\n* ***Star*** this repo \u003ca href=\"#\"\u003e\u003cimg style=\"margin-bottom:-12px\" width=\"72\" alt=\"star\" src=\"https://cloud.githubusercontent.com/assets/5186464/15383105/fcf9cdf0-1dc2-11e6-88db-bf221042a584.png\"\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\n* Buy me a ***Coffee***. ☕️ \n   \n   \u003ca href=\"https://www.paypal.me/WenchaoD\" target=\"_blank\"\u003e\u003cimg src=\"https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg\" width=\"100\" height=\"40\" style=\"margin-bottom:-15px;\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n\t\u003ca href=\"https://user-images.githubusercontent.com/5186464/45949944-46960480-c030-11e8-9e90-30b015698cf6.png\" target=\"_blank\"\u003e\u003cimg src=\"http://a1.mzstatic.com/us/r30/Purple49/v4/50/16/b3/5016b341-39c1-b47b-2994-d7e23823baed/icon175x175.png\" width=\"40\" height=\"40\" style=\"margin-bottom:-15px;-webkit-border-radius:10px;border:1px solid rgba(30, 154, 236, 1);\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\n\t\u003ca href=\"https://cloud.githubusercontent.com/assets/5186464/15096872/b06f3a3a-153c-11e6-89f9-2e9c7b88ef42.png\" target=\"_blank\"\u003e\u003cimg src=\"http://a4.mzstatic.com/us/r30/Purple49/v4/23/31/14/233114f8-2e8d-7b63-8dc5-85d29893061e/icon175x175.jpeg\" height=\"40\" width=\"40\" style=\"margin-bottom:-15px; -webkit-border-radius: 10px;border:1px solid rgba(43, 177, 0, 1)\"\u003e\u003c/a\u003e\n\n--- \n\t\n## Author\n* ***微博：[@WenchaoD](http://weibo.com/WenchaoD)***\n* ***Twitter: [@WenchaoD](https://twitter.com/WenchaoD)***\n* Other repos:\n\t* ***[FSCalendar](https://github.com/WenchaoD/FSCalendar)*** \n\n---\n\n# [Documentation](http://cocoadocs.org/docsets/FSPagerView)","funding_links":["https://www.paypal.me/WenchaoD"],"categories":["Libs","UI","awesome-ios ##","Swift","UI [🔝](#readme)","iOS"],"sub_categories":["UI","Other free courses","Other Testing","Font","CyclePagerView"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenchaoD%2FFSPagerView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWenchaoD%2FFSPagerView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenchaoD%2FFSPagerView/lists"}