Skip to content

ConfianceLabs/CLabsImageSlider

Repository files navigation

CLabsImageSlider

CI Status Version License Platform

Alt text

Example

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

Requirements

Swift 3.0

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", '~> 0.1.2'

Note :-

pod "CLabsImageSlider", '~> 0.1.2' supports Swift 3.0

pod "CLabsImageSlider", '~> 0.1.1' supports Swift 2.2

before executing pod install please verify your pods are updated or execute pod repo update command.

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(imageSource: .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(imageSource: .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, confiancelabs@gmail.com

License

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

About

CLabsImageSlider is a image slider written in swift language.

Resources

License

Stars

Watchers

Forks

Packages

No packages published