To run the example project, clone the repo, and run pod install
from the Example directory first.
Swift 2.2
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.
CLabsImageSlider is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CLabsImageSlider"
From identity inspector replace UIView class of your UIView with CLabsImageSlider class in your xib or StoryBoard.
Create its Outlet.
@IBOutlet weak var imgSlider: CLabsImageSlider!
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)
}
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)
}
- 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)
}
https://www.youtube.com/channel/UCwYjZ3vXQYhJaRwUm6u9-bA
ConfianceLabs, confiancelabs@gmail.com
CLabsImageSlider is available under the MIT license. See the LICENSE file for more info.