appssemble / Inchworm

A slider for adjusting values just like the one in Photo.app in iOS 13

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inchworm

swift 5.0 badge platform iOS badge license MIT badge

Inchworm

A slider for adjusting values just like the one in Photo.app in iOS 13

Inchworm Inchworm Inchworm Inchworm

Requirements

  • iOS 11.0+
  • Xcode 10.0+

CocoaPods

pod 'Inchworm', '~> 0.1'

Usage

  • Create a Slider
let model1 = ProcessIndicatorModel(limitNumber: 30,
                                   normalIconImage: <NormalIconImage1>,
                                   dimmedIconImage: <DimmedIconImage1>)

let model2 = ProcessIndicatorModel(limitNumber: 40,
                                   normalIconImage: <NormalIconImage2>,
                                   dimmedIconImage: <DimmedIconImage2>)

let model3 = ProcessIndicatorModel(limitNumber: 20,
                                   normalIconImage: <NormalIconImage3>,
                                   dimmedIconImage: <DimmedIconImage3>)


let modelList = [model1, model2, model3]

let config = Inchworm.Config()

let board = createSlider(config: config, frame: <Your Frame>, processIndicatorModels: modelList, activeIndex: 1)
  • The caller needs to conform DialBoardDelegate
public protocol SliderDelegate {
func didGetOffsetRatio(_ slider: Inchworm.Slider, activeIndicatorIndex: Int, offsetRatio: Float)
}
Icon used here is from Flickr. by Andreas Kay, is licensed by CC BY-NC-SA 2.0

About

A slider for adjusting values just like the one in Photo.app in iOS 13

License:MIT License


Languages

Language:Swift 95.3%Language:Ruby 3.6%Language:Objective-C 1.1%