LeoMobileDeveloper / Parallexbanner
Licence: mit
【Deprecated】A banner scrollview to show images with parallex effect
Stars: ✭ 28
Programming Languages
swift
15916 projects
ParallexBanner
ParallexBanner is a banner with parallex scroll effect written by pure Swift.
Features
- [x] Storyboard and pure code layout
- [x] Auto scroll
- [x] Infinite scroll
- [x] WebImage and local image (It use Kingfisher to load web image)
- [x] Placeholder image
Requirements
- iOS 8
- ARC
Install
Using CocoaPod
pod "ParallexBanner"
Getting start
ParallexBanner use dataSource and delegate as main interface
Data Source
//Number of banners
func numberOfBannersIn(_ bannner:ParallexBanner)->NSInteger
//You can return a ImageURL(String) or a UIImage object here
func banner(_ banner:ParallexBanner,urlOrImageAtIndex index:NSInteger)->AnyObject
//Return the place holder image here
optional func banner(_ banner:ParallexBanner,placeHolderForIndex index:NSInteger)->UIImage?
//Return the image contentMode here
optional func banner(_ banner:ParallexBanner,contentModeAtIndex index:NSInteger)->UIViewContentMode
Delegate
//Click at index
optional func banner(_ banner:ParallexBanner,didClickAtIndex index:NSInteger)
//Scroll to index
optional func banner(_ banner:ParallexBanner,didScrollToIndex index:NSInteger)
!!! Do not forget to call banner.reloadData()
when model changed.
##Propertys
-
autoScroll
enable timer based scroll -
autoScrollTimeInterval
scroll interval -
enableScrollForSinglePage
enable scroll if there is only single page -
parllexSpeed
the speed of parallex scroll.Better to between 0.1 and 0.8 -
currentIndex
current page index.Readonly -
pageControl
the pageControl object -
transitionMode
set it to .Normal if you do not want parallex scroll.
Author
leo, [email protected]
License
ParallexBanner is available under the MIT license. See the LICENSE file for more info.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].