Latest 1.0.1
Homepage https://github.com/tinyxx/SwiftBanner
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

Cocoapods Compatible
Carthage Compatible
Platform
License

A Cycle Banner by Swift

SwiftBanner

Requirements

iOS8 or higher

Installations

CocoaPods:

pod 'SwiftBanner'

Carthage:

github "tinyxx/SwiftBanner"

Usage

It is quite easy to use, loading image from local:

let banner = SwiftBanner()
banner.bannerItems = [
            BannerItem(imageFetcher: {(imageView) in
            return UIImage(named: "imageName")!
            }, action: {
                print("banner1 press")
        }),
            BannerItem(imageFetcher: {_ in
                return UIImage(named: "imageName")!
                }, action: {
                    print("banner2 press")
            })
        ]

        banner.timeInterval         = 2.8
        banner.autoScrollDirection  = .Left
        banner.pageControlPosition  = .Left

loading image from network:

let banner = SwiftBanner()
banner.bannerItems = [
            BannerItem(imageFetcher: {(imageView) in
                let imageFormNetwork = UIImage() // loading image form network
                imageView.image = imageFormNetwork
                return UIImage(named: "placeholder")!
                }, action: {
                    print("banner1 press")
            }),
            BannerItem(imageFetcher: {(imageView) in
                let imageFormNetwork = UIImage() // loading image form network
                imageView.image = imageFormNetwork
                return UIImage(named: "placeholder")!
                }, action: {
                    print("banner2 press")
            })
        ]

        banner.timeInterval         = 2.8
        banner.autoScrollDirection  = .Right
        banner.pageControlPosition  = .Right

For more infomation, please check the demo project, Thanks!

License

MIT LICENSE

Latest podspec

{
    "name": "SwiftBanner",
    "version": "1.0.1",
    "summary": "A Cycle Banner by Swift",
    "description": "It is a banner view used on iOS, which implement by Swift.",
    "homepage": "https://github.com/tinyxx/SwiftBanner",
    "license": "MIT",
    "authors": {
        "tinyxx": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/tinyxx/SwiftBanner.git",
        "tag": "1.0.1"
    },
    "source_files": "SwiftBanner/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This