Latest 0.1.0
Homepage https://github.com/LeoMobileDeveloper/ParallexBanner
License MIT
Platforms ios 8.0
Dependencies Kingfisher
Frameworks UIKit
Authors

Version Platform
Language
License

ParallexBanner is a banner with parallex scroll effect written by pure Swift.

ParallexBanner

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.

Latest podspec

{
    "name": "ParallexBanner",
    "version": "0.1.0",
    "summary": "A banner to show images with parallex effect",
    "description": "This is a banner to show images with parallex effect.It support both local and Web Image.",
    "homepage": "https://github.com/LeoMobileDeveloper/ParallexBanner",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "leo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LeoMobileDeveloper/ParallexBanner.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ParallexBanner/Classes/**/*",
    "frameworks": "UIKit",
    "dependencies": {
        "Kingfisher": []
    }
}

Pin It on Pinterest

Share This