CLabsImageSlider 0.1.2

CLabsImageSlider 0.1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Dewanshu.



  • By
  • Dewanshu Sharma

CLabsImageSlider

Alt text

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Swift 2.2

Summary

CLabsImageSlider is a image slider written in swift language ,instead of implementing complex logics now you can create image slider with a single line of code. CLabsImageSlider loads local or remote images with multiple options like manual or auto slide etc. So save your time in writing code for page control by using CLabsImageSlider.

Installation

CLabsImageSlider is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CLabsImageSlider"

Step 1

From identity inspector replace UIView class of your UIView with CLabsImageSlider class in your xib or StoryBoard.

Alt text

Step 2

Create its Outlet.

  @IBOutlet weak var imgSlider: CLabsImageSlider!

Step 3 To show slider Images from Url

From viewDidLayoutSubviews function call “SetUpView” function of CLabsImageSlider

let urlImages =    ["https://s26.postimg.org/3n85yisu1/one_5_51_58_PM.png","https://s26.postimg.org/65tuz7ek9/two_5_41_53_PM.png","https://s26.postimg.org/7ywrnizqx/three_5_41_53_PM.png","https://s26.postimg.org/6l54s80hl/four.png","https://s26.postimg.org/ioagfsbjt/five.png"]

override func viewDidLayoutSubviews() {

imgSlider.setUpView(.Url(imageArray:urlImages,placeHolderImage:UIImage(named:"placeHolder")),slideType:.ManualSwipe,isArrowBtnEnabled: true)

    }

To Show Local Images

 let localImages =   ["one.jpg","two.jpg","three.jpg","four.jpg","five.jpg","six.jpg"]

  override func viewDidLayoutSubviews() {

     imgSlider.setUpView(.Local(imageArray: localImages),slideType: .ManualSwipe,isArrowBtnEnabled: true)

    }

Optional Step

  • Apply imageSliderDelegate
class ViewController: UIViewController,imageSliderDelegate

override func viewDidLoad() {
        super.viewDidLoad()

     imgSlider.sliderDelegate   =   self


    }
  • Use its Delegate function
 func didMovedToIndex(index:Int)
    {
        print("did moved at Index : ",index)
    }

YouTube Link

https://www.youtube.com/channel/UCwYjZ3vXQYhJaRwUm6u9-bA

Author

ConfianceLabs, [email protected]

License

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