An iOS Slider written in Swift.

Related tags

Slider JDSlider
Overview

JDSlider

Version License Platform

Preview
Beetripper App's screenshots

Example Project

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

Installation

CocoaPods

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

pod "JDSlider"

Manual

Clone the repository:

$ git clone https://github.com/JellyDevelopment/JDSlider.git

Drag and drop JDSlider.swift file into your project. Add import JDSlider to all view controllers that need to use it.

##Usage

  • Create an UIView in Interface Builder and change to JDSliderView class.
  • Set the Slider's Delegate and Datasource
class ViewController: UIViewController, JDSliderDataSource, JDSliderDelegate {

    //MARK: @IBOutlet
    @IBOutlet var sliderView: JDSliderView!
    
    //MARK: LifeCycle
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        self.sliderView.delegate    = self
        self.sliderView.datasource  = self
    }
}
  • Implement JDSliderDataSource, JDSliderDelegate
//MARK: JDSliderDelegate
func slider(jdSlider: JDSliderView, didSelectSlideAtIndex index: Int) {
   print("Touch slide with index: \(index)")
}
   
//MARK: JDSliderDataSource
func slider(jdSliderNumberOfSlides slider: JDSliderView) -> Int {
   return self.arrayImages.count
}
    
func slider(jdSlider: JDSliderView, viewForSlideAtIndex index: Int) -> UIView {
   let imageView = UIImageView()
   imageView.image = UIImage(named: self.arrayImages[index])
            
   return imageView
}
  • You can customize the page indicator's color
self.sliderView.tintPageIndicator(UIColor.orangeColor(), state: .Highlight)
self.sliderView.tintPageIndicator(UIColor.blackColor(), state: .Normal)

Author

License

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

You might also like...
Customizable animated slider for iOS
Customizable animated slider for iOS

MMSegmentSlider MMSegmentSlider is an easy-to-use IBDesignable animated slider for iOS 7+ written in Objective-C. Installation From CocoaPods CocoaPod

A custom reusable circular / progress slider control for iOS application.
A custom reusable circular / progress slider control for iOS application.

HGCircularSlider Example To run the example project, clone the repo, and run pod install from the Example directory first. You also may like HGPlaceho

iOS 11 Control Center Slider
iOS 11 Control Center Slider

SectionedSlider Control Center Slider Requirements Installation Usage License Requirements iOS 8.0+ Swift 3.0+ Xcode 8.0+ Installation CocoaPods Cocoa

Customizable animated slider for iOS
Customizable animated slider for iOS

MMSegmentSlider MMSegmentSlider is an easy-to-use IBDesignable animated slider for iOS 7+ written in Objective-C. Installation From CocoaPods CocoaPod

An iOS-16-styled slider.

Slyderin An iOS-16-styled slider. Available on iOS 13 and later. Slyderin.Demo.mov How to Use Include it with Swift Package Manager. Add it to your vi

A simple range slider made in Swift
A simple range slider made in Swift

RangeSlider Summary A simple range slider made in Swift. Screenshot Use This control is IBDesignable and uses the target-action pattern for change not

💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion
💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion

FLUID SLIDER A slider widget with a popup bubble displaying the precise value selected written on Swift. We specialize in the designing and coding of

FlowerSlider - Flower Slider Animation Built With Swift
FlowerSlider - Flower Slider Animation Built With Swift

FlowerSlider Shape Slider Screenshot

🎚️ STDiscreteSlider – slider which allows user to choose value only from predefined set of data.
🎚️ STDiscreteSlider – slider which allows user to choose value only from predefined set of data.

STDiscreteSlider – slider which allows user to choose value only from predefined set of data. Slider may receive any types of options, you may pass set of integers or strings, or any other type. Written using SwiftUI.

Comments
  • Page Controll wrong x position

    Page Controll wrong x position

    Using 2 images the page controll indicators was palced on the right side of the screen. I fixed it by changing orgin.x from self.center.x to 0

    self.pageControl.frame.origin.x = 0

    opened by Sonberg 3
  • reloadData but not work!

    reloadData but not work!

    when i get my data at few time i guess

    self.jdSliderScrollView.hidden still hidden

    so i fix it

           if self.numbersOfSlides == 0 {
    
                self.pageControl.hidden        = true
                self.jdSliderScrollView.hidden = true
    
            } else if self.numbersOfSlides > 0{
    
                self.pageControl.hidden        = false
                self.jdSliderScrollView.hidden = false
            //.......
    
    opened by george845b034 1
Owner
Jelly Development
Jelly Development
An iOS Slider written in Swift.

JDSlider Beetripper App's screenshots Example Project To run the example project, clone the repo, and run pod install from the Example directory first

Jelly Development 84 Jul 26, 2022
IntervalSlider is a slider library like ReutersTV app. written in pure swift.

IntervalSlider Description and appetize.io`s DEMO To run the example project, clone the repo, and run pod install from the Example directory first. Re

Nobuyasu 65 May 23, 2021
CircleSlider is a Circular slider library. written in pure Swift.

CircleSlider Description and appetize.io`s DEMO Usage To run the example project, clone the repo, and run pod install from the Example directory first

Nobuyasu 142 May 9, 2022
A feature-rich circular slider control written in Swift.

MTCircularSlider Screenshot Usage To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 1

Eran Boudjnah 132 Jan 1, 2023
A powerful Circular Slider. It's written in Swift, it's 100% IBDesignable and all parameters are IBInspectable.

CircularSlider A powerful Circular Slider. It's written in Swift, it's 100% IBDesignable and all parameters are IBInspectable. Demo Installation Circu

Matteo Tagliafico 253 Sep 19, 2022
VerticalSlider - An animatable and customizable vertical slider written in Swift 4

VerticalSlider An animatable and customizable vertical slider written in Swift 4. Quick Start VerticalSliderPlayground Clone Repo Open VSVerticalSlide

Vincent Smithers 13 Apr 26, 2022
A beautiful slider control for iOS built purely upon Swift

SnappingSlider A beautiful slider control for iOS. Installation There are two ways to add the control to your project; you can add it as a submodule i

Rehat Kathuria 577 Dec 15, 2022
VerticalSlider is a vertical slider control for iOS in Swift.

?? VerticalSlider If you like VerticalSlider, give it a ★ at the top right of this page. Overview VerticalSlider is a vertical implementation of the U

Jon Kent 78 Sep 15, 2022
This is an iOS Tweak that modifies the brightness slider in the Control Center.

AdvancedBrightnessSlider Tweak This is an iOS Tweak that modifies the brightness slider in the Control Center. Even with dark mode toggled on, I found

Jonas Schiefner 18 Jan 5, 2023
Use UIResponder to imitate an iOS slider.

WWSlider Use UIResponder to imitate an iOS slider. 使用UIResponder仿造一個iOS的滑桿. Installation with Swift Package Manager dependencies: [ .package(url:

William-Weng 2 May 5, 2022