Latest 1.1.0
License MIT
Platforms ios 8.0, requires ARC

Carthage Compatible

Easy to create image slider in Swift


  • [x] pure swift 3.1 code
  • [x] class is custom UIView , not UIPageViewController
  • [x] you can download image use iOS native SDK or other 3rd SDK
  • [x] require iOS 8 or later

Style One

Style Two



AACarousel is available through CocoaPods.

Simply add AACarousel to your Podfile.

pod 'AACarousel'

Enter command instruction into your terminal.

pod install


AACarousel is available through Carthage.

Simply add AACarousel to your Cartfile.

github "Alan881/AACarousel"

Enter command instruction into your terminal.

carthage update --platform iOS


You must create UIView and it use custom class in the storyboard after install AACarousel.

Then you must also create a IBOutlet in your UIViewController Class with AACarouselDelegate.

The following sample code for your reference.

    var titleArray = [String]()

    override func viewDidLoad() {

        let pathArray = ["",
        titleArray = ["picture 1","picture 2","picture 3","picture 4","picture 5"]
        carouselView.delegate = self
        carouselView.setCarouselData(paths: pathArray,  describedTitle: titleArray, isAutoScroll: true, timer: 5.0, defaultImage: "defaultImage")
        //optional methods
        carouselView.setCarouselOpaque(layer: false, describedTitle: false, pageIndicator: false)
        carouselView.setCarouselLayout(displayStyle: 0, pageIndicatorPositon: 5, pageIndicatorColor: nil, describedTitleColor: nil, layerColor: nil)
    //require method
    func downloadImages(_ url: String, _ index: Int) {

        //here is download images area
         let imageView = UIImageView()
        imageView.kf.setImage(with: URL(string: url)!, placeholder: UIImage.init(named: "defaultImage"), options: [.transition(.fade(0))], progressBlock: nil, completionHandler: { (downloadImage, error, cacheType, url) in
            self.carouselView.images[index] = downloadImage!
    //optional method (interaction for touch image)
    func didSelectCarouselView(_ view: AACarousel ,_ index: Int) {

        let alert = UIAlertView.init(title:"Alert" , message: titleArray[index], delegate: self, cancelButtonTitle: "OK")


    //optional method (show first image faster during downloading of all images)
    func callBackFirstDisplayView(_ imageView: UIImageView, _ url: [String], _ index: Int) {

        imageView.kf.setImage(with: URL(string: url[index]), placeholder: UIImage.init(named: "defaultImage"), options: [.transition(.fade(1))], progressBlock: nil, completionHandler: nil)


    func startAutoScroll() {
       //optional method


    func stopAutoScroll() {
        //optional method


AACarousel is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "AACarousel",
    "version": "1.1.0",
    "license": {
        "type": "MIT",
        "file": ""
    "summary": "Image Slider in Swift",
    "homepage": "",
    "authors": {
        "Alan": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"
    "pushed_with_swift_version": "3.1"

Pin It on Pinterest

Share This