This commit is contained in:
Xavier Schott 2015-02-18 19:41:07 -08:00
parent 038b5fbd45
commit 243121035c
1 changed files with 8 additions and 3 deletions

View File

@ -95,6 +95,11 @@ You can then use TGPCamelLabels on top of other UI elements with no ill effet.
![image](https://cloud.githubusercontent.com/assets/4073988/5910599/b775b6e8-a570-11e4-9846-d990ca0f8c9c.png)
###Code example
See **TGPControlsDemo** projects:
1. `TGPControlsDemo` (iOS 8 + Swift + IBInspectable)
2. `TGPControlsDemo7` (iOS 7 + ObjC) projects.
```
#import "ViewController.h"
#import "TGPDiscreteSlider.h"
@ -127,9 +132,9 @@ You can then use TGPCamelLabels on top of other UI elements with no ill effet.
@"N",@"O",@"P",@"Q",@"R",@"S", @"T",@"U",@"V",@"W",@"X",@"Y",@"Z"];
self.switch1Camel.names = @[@"OFF", @"ON"];
// Match the ticks spacing exactly
self.alphabetLabels.ticksDistance = self.alphabetSlider.ticksDistance;
self.oneTo10Labels.ticksDistance = self.oneTo10Slider.ticksDistance;
// Automatically track tick spacing changes
self.alphabetSlider.ticksListener = self.alphabetLabels;
self.oneTo10Slider.ticksListener = self.oneTo10Labels;
}
#pragma mark TGPDiscreteSlider