Code Monkey home page Code Monkey logo

tgpcontrols's Introduction

TGP Controls

Build Status CocoaPods Carthage compatible MIT License

Demo Project

Slider with ticks & animated Label (Swift)

TGPControls are drop-in replacement of UISlider & UILabel, with visual preview in Interface Builder, single liner instrumentation, smooth animations, simple API, powerful customization.

What's DiscreteSlider?

ticksdemo

TGPDiscreteSlider: A slider with discrete steps (i.e. ticks), discrete range, with customizable track, thumb and ticks. Ideal to select individual steps, star rating, integers, rainbow colors, slices and in general any value that is not a continuum. Just set the number of stops, TGPDiscreteSlider handles the selection and the animations for you.

What's CamelLabels?

camellabels2

TGPCamelLabels: A set of animated labels (dock effect) representing a selection. Can be used alone or in conjunction with a UIControl. Ideal to represent steps. The discrete slider and the camel labels can work in unison.

Compatibility

  1. Written in Swift 4, can be integrated with Swift or Obj-C
  2. TGPControls are AutoLayout, IB Designable and IB Inspectable ready
  3. Version 5.0.1 and better comes with a Swift 4 demo application for iOS 8 and above.
    iOS 7 supported in versions 2.1.0 and earlier
  4. Automatic support for both left-to-right and right-to-left languages

imagessliderdemo

Copyright disclaimer
The above slider is inspired by National Parks by National Geographic iPhone App.
National Parks iPhone App is developed by Rally Interactive LLC.
The above image, styling, appearance and look & feel all Copyright © 2015 National Geographic Society.
TGPControls is not associated with National Geographic Society, Rally Interactive LLC or any of it's subsidiaries.

Fully Customizable

alphabetslider

Control everything about the slider or its labels, starting with colors, images and fonts, including track and ticks shape, and thumb shadows. All computations regarding range and sizing and handled automatically. Use the two classes in tandem to create stunning new controls, which can be resized dynamically, to intergrate beautifully into your application.

onoff

Most customization can be done in Interface Builder and require zero coding.


How to integrate (iOS 8 and higher)

Using CocoaPods

platform :ios, '8.0'
use_frameworks!
target 'TGPControlsDemo' do
pod 'TGPControls'
end

Using Carthage

github "SwiftArchitect/TGPControls"

Besides customization, which you can do entirely under Interface Builder in iOS 8 and later, both TGPDiscreteSlider and TGPCamelLabels require surprisingly little code to integrate.

DiscreteSlider

For simplicity, TGPDiscreteSlider does not descend from UISlider but from UIControl. It uses a minimumValue, a tickCount and an incrementValue (instead of minimumValue and maximumValue). All graphic aspects, such as physical spacing of the ticks or physical width of the track are controlled internally. This makes TGPDiscreteSlider predictable. it is guaranteed to always fit snuggly inside its bounds.

Single step: To use DiscreteSlider + CamelLabels in tandem, you need exactly 1 line of code:

discreteSlider.ticksListener = camelLabels

complete

That's all!
Through the TGPControlsTicksProtocol, the camelLabels listen to value and size changes. You may want to adopt this protocol to handle changes, or use the traditional UIControl notifications:

Advanced Steps (1a): register to notifications (just like any UIControl)

discreteSlider.addTarget(self,
action: #selector(valueChanged(_:event:)),
for: .valueChanged)

Advanced Steps (1b): respond to notification

func valueChanged(_ sender: TGPDiscreteSlider, event:UIEvent) {
self.stepper.value = Double(sender.value)
}

tickStyle, trackStyle, thumbStyle Properties:

Constant Value
.iOS 0 Gives to any component the iOS appearance: Ticks are invisible, track is blue and gray, thumb is round with a shadow
.rectangular 1 Boxy look with hard edges
.rounded 2 From rounded rectangles to perfects circles, depending on vertical to horizontal ratio
.invisible 3 Surprisingly useful to individually hide ticks, track, or even thumb

Other Properties:

Listener
ticksListener a TGPControlsTicksProtocol listener, such as TGPCamelLabels, which receives spacing changes notifications.
allTargets Inherited from UIControl, receives actions for control event
Tick
tickStyle See style property
tickSize absolute dimension
tickCount discrete steps, must be 2 or greater
minimumTickTintColor lower side ticks ; takes precedence over minimumTrackTintColor (†1)
maximumTickTintColor higher side ticks ; takes precedence over maximumTrackTintColor (†1)
tickImage a UIImage, fits in tickSize (†)
ticksDistance horizontal spacing (calculated)
Track
trackStyle See style property
trackThickness height
trackImage a UIImage, ignores trackThickness (†2)
minimumTrackTintColor track lower side
maximumTrackTintColor track higher side
Thumb
thumbStyle See style property
thumbSize absolute size
thumbTintColor background
thumbImage aUIImage, dictates thumbSize (†)
thumbShadowRadius breaking the flat design concept
thumbShadowOffset applied to thumbShadowRadius, may affect control bounds

(†1) Introduced in 5.1.0. (†2) Introduced in 4.0.0. Former versions used a resource name as a string.

image

CamelLabels

Besides font customization, TGPCamelLabels only requires a set of labels (supplied as strings), and an active index selection.

Step 1: tell the TGPCamelLabels what to select (Refer to Single step section above to use DiscreteSlider + CamelLabels in tandem)

camelLabels.value = sender.value

There is no step 2. Most of the customization can be done inside Interface Builder.

Properties:

Property
tickCount design only (preferrably not to be used): the number of ticks is driven by the number of elements in the names array
names supplies a new set of labels ; supersedes the tickCount property, which will return the number of labels. A typical use may be camelLabels.names = ["OFF", "ON"]
ticksListener ties a discrete slider to its camel labels. This is your most robust method to not only ensure that the layout of both controls match exactly, but also adjust this spacing when orientation changes. A typical use may be discreteSlider.ticksListener = camelLabels
ticksDistance override the labels spacing entirely ; prefer the ticksListener mechanism if it is available to you. A typical use may be camelLabels.ticksDistance = 15
value which label is emphasized (selected)
backgroundColor labels become tap-through (click-through) when set to UIColor.clear ; use TGPCamelLabels on top of other UI elements, even native iOS objects!(*)

(*) You can tap on the UISwitch laid out either under or below the camel labels: uiswitch

Edges & Animation
numberOfLiness Support for multiple lines labels
offCenter leftmost and righmost labels only: relative inset expressed as a proportion of individual label width: 0: none, +0.5: nudge in by a half width (fully fit) or -0.5: draw completely outside
insets leftmost and righmost labels only: absolute inset expressed in pixels
emphasisLayout emphasized (selected) labels vertical alignment ; .top, .centerY or .bottom. Default is .top (‡)
regularLayout regular labels vertical alignment ; .top, .centerY or .bottom. Default is .bottom (‡)

(‡) No camel animation will occur when emphasisLayout = regularLayout, i.e. .centerY.

Emphasized labels
upFontName font
upFontSize size
upFontColor color
Regular labels
dnFontName font
dnFontSize size
dnFontColor color

Code example (Swift)

See TGPControlsDemo project: TGPControlsDemo (Modern Swift syntax + IBInspectable)

Running the demo using Carthage

  1. cd TGPControlsDemo
  2. carthage update
  3. open TGPControlsDemo.xcodeproj
  4. Select scheme TGPControlsDemo Cart
  5. Build & run

Running the demo using Cocoapods

  1. cd TGPControlsDemo
  2. pod install
  3. open TGPControlsDemo.xcworkspace
  4. Select scheme TGPControlsDemo Pods
  5. Build & run
import UIKit
import TGPControls

class ViewController: UIViewController {
@IBOutlet weak var oneTo10Labels: TGPCamelLabels!
@IBOutlet weak var oneTo10Slider: TGPDiscreteSlider!
@IBOutlet weak var alphabetLabels: TGPCamelLabels!
@IBOutlet weak var alphabetSlider: TGPDiscreteSlider!
@IBOutlet weak var switch1Camel: TGPCamelLabels!

override func viewDidLoad() {
super.viewDidLoad()

alphabetLabels.names = [
"A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
switch1Camel.names = ["OFF", "ON"]

// Automatically track tick spacing and value changes
alphabetSlider.ticksListener = alphabetLabels
oneTo10Slider.ticksListener = oneTo10Labels
}

// MARK: - UISwitch
@IBAction func switch1ValueChanged(_ sender: UISwitch) {
switch1Camel.value = (sender.isOn) ? 1 : 0
}
}

Customization examples

image

custom

tgpcontrols's People

Contributors

duongel avatar hebertialmeida avatar jayliew avatar peterhaldbaek avatar readmecritic avatar smamczak avatar swiftarchitect avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tgpcontrols's Issues

setValue

Hello and thanks for your library.
i have setup a TGPDiscreteSlider7 on my storyboard and i would like to change its value programmatically. Calling setValue on the control does not seem to do anything. The slider does not move.
Am i missing something in the implementation in order to make it move programmatically?
thanks

EDIT:
calling setValue on your oneTo10Slider in the demo project works as expected.
calling setValue on either of the last 2 sliders in the demo project does not work and i have set them up as a property so i can call them

By the way...calling setValue on anywhere else than viewDidLoad even on the oneTo10Slider does not move it.

Can't find the UI objects

Hi,

I can't manage to find the UI objects that come with TGPControls (i.e. TGPCamelLabel, TGPDiscreteSlider). I've been looking inside the object library, but none of them are there. Am I doing something wrong?

TGPCamelLabel.ticksDistance is not same as TGPDiscreteSlider.ticksDistance

As per the read me, I did the following to ensure that the label appears correctly above the discrete slider ticks.

camelLabel.ticksDistance = discreteSlider.ticksDistance

When I do that I get the following
ticks

Context:

  1. Both the discreteSlider and the camelLabel are created in storyboard by changing the class of UIView to the TGPDiscreteSlider and TGPCamelLabel respectively.
  2. Installed the TGPControls via CocoaPods
  3. Using Xcode 6.4 , iOS 8, Swift 1.2
  4. The tick labels are assigned in viewDidLoad as ["0", "1" ... "10"] . As you can notice 1, 9 and 10 are rendering outside the screen. The screenshot is on iPhone 6 Plus actual device
  5. The TGPDiscreteSlider and the TGPCamelLabel have the trailing to super view trailing and leading to superview.leading set to 0. ( basically the constraints ask it to occupy the width of the device

Would appreciate if you could guide me on what I am doing incorrectly

Right to Left layout

Hi,

TGP Controls remain left to right even though all app layout is right to left...

Can you help please in this :)

Add support for multiline labels

Hi, It would be nice to support multiple lines in labels. I want to choose a chart using TGPDiscreteSlider but It has a long name e.g. Temperature Chart. I wanted to write name like "Temperature\nChart" but it only shows first line.

I have created a pull request with necessary changes #35

Crashes on send event

  func sendActionsForControlEvents() {
        // Automatic UIControlEventValueChanged notification
        if let ticksListener = ticksListener {
            ticksListener.tgpValueChanged(value: UInt(value))  <<======EXC_BADness
        }
    }

value was -1.0

?

Swift 5

I see there are unanswered Swift 4.2 pull requests. Is this repo still in maintenance or dead?
I'm willing to migrate things to Swift 5 just let me know if you will review changes once they are done. Thanks!

Proposed Enhancement - Range Slider

This component set is awesome! Have you considered adding a Range Slider style component that has an upper thumb and a lower thumb?

Thanks for all your hard work, it really paid off!! 👍 👍

Unable to Edit using Interface Builder

Hi,

I was able to successfully add a TGPDiscreteSlider into my project using Carthage and I saw the slider appear when running the app. However, I am experiencing some issues working with it inside interface builder. No additional customization options appear in interface builder's attributes panel like I expected.

Also, to create the slider, I needed to manually type the custom Class and Module when creating the slider, as it was not in the dropdown menus for the class and module fields.

Have these issues appeared for anyone else?

Dynamic resizing

The slider and the camel must be manually resized after orientation changes. This could be done automatically. Furthermore, the camel spacing and the slider ticks spacing would gain in being bound more closely, so that a change in the ticks spacing can be reflected in the camel spacing.

TGPCamelLabel.ticksDistance is not same as TGPDiscreteSlider.ticksDistance

As per the read me, I did the following to ensure that the label appears correctly above the discrete slider ticks.

camelLabel.ticksDistance = discreteSlider.ticksDistance

When I do that I get the following
ticks

Context:

  1. Both the discreteSlider and the camelLabel are created in storyboard by changing the class of UIView to the TGPDiscreteSlider and TGPCamelLabel respectively.
  2. Installed the TGPControls via CocoaPods
  3. Using Xcode 6.4 , iOS 8, Swift 1.2
  4. The tick labels are assigned in viewDidLoad as ["0", "1" ... "10"] . As you can notice 1, 9 and 10 are rendering outside the screen. The screenshot is on iPhone 6 Plus actual device
  5. The TGPDiscreteSlider and the TGPCamelLabel have the trailing to super view trailing and leading to superview.leading set to 0. ( basically the constraints ask it to occupy the width of the device

UILabel instantiation called on each layoutTrack

I was having an issue with labels being recreated on view resize. Specifically, the labels appeared to drop in from the top left which wasn't exactly what I wanted. This was a result of the labels being recreated whenever layoutTrack was called.

To fix this, I made a change so that the labels are only recreated when the names array is set. layoutTrack then only modifies the frames of the labels. When animating, this looks a bit better (in my opinion).

Is this a modification you'd look at a pull request for? (I'm not sure the extent of my changes but I believe they function correctly.)

Swift : Crash while run the sample application.

Thanks for sharing the slider control which is more helpful for customization.

Application is crashed while running the sample application, please find the below the information.
XCode 8.3.2, Swift 3.0, iOS 10.3

Please find the below crash information.

-[UIView setNames:]: unrecognized selector sent to instance 0x7fef03705dc0
2017-09-09 00:49:38.409 TGPControlsDemo-Pods[2582:42613] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setNames:]: unrecognized selector sent to instance 0x7fef03705dc0'
*** First throw call stack:
(
0 CoreFoundation 0x00000001097d9b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010923e141 objc_exception_throw + 48
2 CoreFoundation 0x0000000109849134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000109760840 forwarding + 1024
4 CoreFoundation 0x00000001097603b8 _CF_forwarding_prep_0 + 120
5 TGPControlsDemo-Pods 0x0000000108c2fc61 TFC20TGPControlsDemo_Pods14ViewController11viewDidLoadfT_T + 2257
6 TGPControlsDemo-Pods 0x0000000108c31232 TToFC20TGPControlsDemo_Pods14ViewController11viewDidLoadfT_T + 34
7 UIKit 0x0000000109d9fcca -[UIViewController loadViewIfRequired] + 1235
8 UIKit 0x0000000109da010a -[UIViewController view] + 27
9 UIKit 0x0000000109c6863a -[UIWindow addRootViewControllerViewIfPossible] + 65
10 UIKit 0x0000000109c68d20 -[UIWindow _setHidden:forced:] + 294
11 UIKit 0x0000000109c7bb6e -[UIWindow makeKeyAndVisible] + 42
12 UIKit 0x0000000109bf531f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346
13 UIKit 0x0000000109bfb584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
14 UIKit 0x0000000109bf8793 -[UIApplication workspaceDidEndTransaction:] + 182
15 FrontBoardServices 0x0000000110cac5f6 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
16 FrontBoardServices 0x0000000110cac46d -[FBSSerialQueue _performNext] + 186
17 FrontBoardServices 0x0000000110cac7f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
18 CoreFoundation 0x000000010977fc01 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
19 CoreFoundation 0x00000001097650cf __CFRunLoopDoSources0 + 527
20 CoreFoundation 0x00000001097645ff __CFRunLoopRun + 911
21 CoreFoundation 0x0000000109764016 CFRunLoopRunSpecific + 406
22 UIKit 0x0000000109bf702f -[UIApplication _run] + 468
23 UIKit 0x0000000109bfd0d4 UIApplicationMain + 159
24 TGPControlsDemo-Pods 0x0000000108c341a7 main + 55
25 libdyld.dylib 0x000000010d87d65d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Label vertical animations control

Generalize label vertical positioning so that they can be drawn at the top, center, or bottom of the control.

Applying the same vertical positioning rule to both selected and deselected labels virtually freezes the animation, same as setting animate to NO.

Remove animate, which is obsolete.

Feature Request: Rotating the control to make it vertical?

Does anyone have any tips on how to modify these utterly fantastic classes in order to make them vertical instead of horizontal?

I made a class called RotatableSlider that I use for standard UISliders to be able to rotate them to either ascend in value vertically or descend in value vertically.

In my RotatableSlider class, there's an IBInspectable variable called "aspect" which is an Int. If "aspect" is 0, the slider is horizontal. If "aspect" is -1, the slider is rotated 90º counterclockwise from horizontal so it's vertical and ascending in value as you slide the slider up. If "aspect" is 1, the slider is rotated 90º clockwise from horizontal so it's vertical and descending in value as you slide the slider up.

It works great to rotate sliders to vertical orientation right inside of IB, but trying to modify the TGPDiscreteSlider class to do the same thing is giving me trouble.

Has anyone out there modified TGPDiscreteSlider yet to support it being vertical rather than horizontal? If not, is this a feature the contributors would consider implementing?

I think adding this capability so that changing the "aspect" of the control programmatically or in IB to rotate the TGPDiscreteSlider to vertical ascending or descending would be a great feature addition to an already fantastic control.

Linking Slider & CamelLabels doesn't update labels right away

There are 2 methods to link the ticks spacing between the DiscreteSlider and the CamelLabels:

  • manually (get TGPDiscreteSlider.ticksDistance & set TGPCamelLabels.ticksDistance)
  • automatically (self.discreteSlider.ticksListener = self.camelLabels)

The automatic method should apply ticksDistance right away.

Swift 4 support

Hi, are there any plans to support Swift 4 in the near future? Thank you.

Swift 3.0/ Xcode 8 support

Hi, I'm looking to migrate my code to Swift 3. I was wondering if you will provide support for Swift 3 in the near future. Thanks!

Can't even compile the demo project

2017-03-16 15:29:37.257 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls14TGPCamelLabels in Interface Builder file.
2017-03-16 15:29:37.258 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls17TGPDiscreteSlider in Interface Builder file.
2017-03-16 15:29:37.269 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls17TGPDiscreteSlider in Interface Builder file.
2017-03-16 15:29:37.270 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls14TGPCamelLabels in Interface Builder file.
2017-03-16 15:29:37.272 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls17TGPDiscreteSlider in Interface Builder file.
2017-03-16 15:29:37.275 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls14TGPCamelLabels in Interface Builder file.
2017-03-16 15:29:37.276 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls17TGPDiscreteSlider in Interface Builder file.
2017-03-16 15:29:37.277 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls14TGPCamelLabels in Interface Builder file.
2017-03-16 15:29:37.278 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls14TGPCamelLabels in Interface Builder file.
2017-03-16 15:29:37.287 TGPControlsDemo[6399:144694] Unknown class _TtC11TGPControls17TGPDiscreteSlider in Interface Builder file.
2017-03-16 15:29:37.313 TGPControlsDemo[6399:144694] Failed to set (tickCount) user defined inspected property on (UIView): [<UIView 0x7fabea504120> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tickCount.
2017-03-16 15:29:37.314 TGPControlsDemo[6399:144694] Failed to set (ticksDistance) user defined inspected property on (UIView): [<UIView 0x7fabea504120> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ticksDistance.
2017-03-16 15:29:37.314 TGPControlsDemo[6399:144694] Failed to set (value) user defined inspected property on (UIView): [<UIView 0x7fabea504120> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key value.

Better support for end labels location

Add 2 new properties:

  • offCenter
    Label off-center to the left and right of the slider, expressed in label width. 0: none, -1/2 half out, 1/2 half in.

Usage:
offCenter = 0.0: end labels are centered over ticks (default)
offCenter = 0.5: end labels are inset inwards by half their respective width. Thus, they fit entirely within the slider rect. Overlap may occur.
offCenter = -0.5: ends labels are outset outwards by half their respective width. Thus, they are drawn outside of the slider rect.

  • insets
    Label margins to the left and right of the slider

Usage:
insets = 0: end labels are centered (default)
insets = n: end labels are inset (positive number) or outset (negative number) n pixels.

offCenter and insets can be combined, and set from Interface Builder.

Example:
offCenter = 1/2 (one half inwards)
insets = -6 (once the labels are left and right justified, apply an outset of 6 pixels to align neatly with the slider image)
screen shot 2017-02-04 at 6 37 46 pm

rendering example:
Notice on how Orient & Midi align exactly with slider.
simulator screen shot feb 4 2017 6 37 37 pm

original:
simulator screen shot feb 4 2017 6 38 22 pm

Range In Slider

Hello ,

Can you do 1 thing in TGPControls Slider , please add the range slider with this.
I am attaching the image for batter understanding , and please revert me asap,
Please do something like this?? its help a lot for my requirements.

screen shot 2018-09-14 at 11 28 44 am

Color for thumb image

First of all, great job for doing this amazing component.

I struggle a bit setting the color of the thumb when using a vector image. Looking at the code, when we change the thumb tint color, it will only affect the background of the thumb and not the image itself because the image is inserted as CGImage in the thumbLayer.

How are we supposed to set a color for the thumb image ?

Different colour/image to selected and not selected ticks

Hello SwiftArchitect Team!
First off all thank you very much for this awesome plugin! It helped me a lot :)
I have one question/issue. Is there a way to assign different image/colour to ticks on the left of thumb and ticks on the right?

Thanks!

Provide mechanism to hide thumb

DiscreteSlider thumb could be hidden when .value < .minimumValue.
This is a simple mechanism to present the slider in an inviting "tap me" mode, without showing an actual default value.

Add Cartfile

Demo app should support 2 schemes:

  1. Carthage
  2. Cocoapods

Update documentation accordingly and add app icon.

Using gradients for the background

I'm trying to achieve this result:
screen shot 2018-05-23 at 3 01 40 pm

But I can't seem to find a way to use gradients in the controls. Any idea how can I go about doing this?

Thanks!

Automatically update the Camels when Slider changes

Reduce the dependency for UIControlEventValueChanged and improve integration.

Since a TGPCamelLabels is generally tied to a TGPDiscreteSlider via a TGPControlsTicksProtocol, notify the camel when slider changes, saving some lines of code in the host application.

Use of undeclared type 'TGPDiscreteSlide'

I have imported the TGPControls framework to my app, added these imports to the top of my swift controller:
import UIKit
import TGPControls

but I get undeclared type when I try to create the object.
@IBOutlet weak var discreteSlider: TGPDiscreteSlide!

What am I doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.