Home

Awesome

Banana - ImageSlider for Swift

Swift 2.0 CocoaPods

Image slider with very simple interface.

At a Glance

@IBOutlet weak var imageScrollView: UIScrollView!
// Here imageArray can be a string array of Image URLs 
var imageArray = [String]()

//or imageArray can be a array of UIImages
var imageArray = [UIImage]()

var imageScroll = banana( imageScrollView :self.imageScrollView )
//Load to load images in memory and display them in User Interface
imageScroll!.load(imageArray)

//Call startScroll for autoScrolling. Default scrolling timer is 8 seconds
imageScroll!.startScroll()

//Call this function to stop autoScrolling on touch or swipe.
imageScroll!.assignTouchGesture()

Features

Installation

Objective-C

banana is compatible with Objective-C. What you need to do is to import a auto-generated header file:

#import <banana/banana.h>

Setting AutoScroll Delay and Caching threshold

var imageScroll = banana( imageScrollView :self.imageScrollView )
imageScroll.autoScrollTime = 2 // < Any integer value in seconds >

//banana library doesn't load all images at once in memory, but only some images (one in display and one or two before and after are loaded). Images are loaded and unloaded dynamically. Default is 4
imageScoll.imagesToLoadInMemory = 10

Advanced

//You can also assign a UIPageControl.
@IBOutlet weak var imageScrollView: UIScrollView!
@IBOutlet weak var imagePageControl: UIPageControl!

var imageScroll = banana( imageScrollView :self.imageScrollView, imagePageControl : self.imagePageControl )
self.imageScroll!.load(imageArray)
self.imageScroll!.startScroll()
self.imageScroll!.assignTouchGesture()

Screenshots

<ToDo>

License

banana is released under the MIT license. See LICENSE file for more info.