• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A UISlider subclass which adjusts its appearance based on the positional attitude of an iOS device.

TLTiltSlider

TLTiltSlider is a UISlider subclass with an angular gradient for a Thumb image which adjusts its appearance based on the positional attitude of the device. The movement of the gradient when re-orientating the device is subtle. This mimics the iOS 6 Music app (notice the gradient on the sliders).

This class demonstrates how to use the Core Motion framework to adjust to device attitude changes. Rendering angular gradients is complex and it may affect your application's responsiveness on older devices. Always make sure to test your application on an actual device.

One angular gradient Another angular gradient

How to Use

Drag TLTiltSlider.h and TLTiltSlider.m, as well as the images in the Resources directory, into your project. Make sure to link against the Core Motion framework.

Alternatively, you can use CocoaPods:

pod search TLTiltSlider

Create an instance of TLTiltSlider and add it to a view hierarchy. The UISlider superclass will centre itself vertically within the view; optimal sizes are 23pt or greater.

TLTiltHighlightView *slider = [[TLTiltSlider alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 23)];
[self.view addSubview:slider];

Slider

Alternatively to instantiating the class programmatically, you can also use Interface Builder by selecting the Identity Inspector and changing the class of a view.

Identity Inspector

You can also disable the tilt updates for older devices:

slider.tiltEnabled = NO;

Requirements

You must link with Core Motion. This project requires ARC.

More Repositories

1

Hyperlapse.js

JavaScript hyper-lapse utility for Google Street View.
JavaScript
2,350
star
2

Upcoming

Objective-C
882
star
3

UITableViewCell-Swipe-for-Options

A reproduction of the iOS 7 Mail app's swipe-to-reveal options
Objective-C
614
star
4

UICollectionView-Spring-Demo

A demonstration of UICollectionView and UIKit Dynamics
Objective-C
478
star
5

TLTiltHighlightView

A horizontal gradient which adjusts its appearance based on the positional attitude of an iOS device.
Objective-C
286
star
6

UIViewController-Transitions-Example

An example of how to use the new iOS 7 APIs to create custom view controller transitions.
Objective-C
268
star
7

UIKit-Dynamics-Example

An example of a sidebar menu animated completely with UIKit Dynamics on iOS 7
Objective-C
248
star
8

TLAlertView

A replacement for 1-button UIAlertView that uses Blurring and UIKit Dynamics on iOS 7.
Objective-C
173
star
9

SwiftSocketIODemo

Swift & SocketIO Demo
Objective-C
61
star
10

ofxAsciiArt

Add-on for openFrameworks - GPU based real-time ASCII Art filter.
C++
54
star
11

GaTrackEvents-Jquery-Plugin

GaTrackEvents is a lightweight jQuery plugin to quickly tag Google Analytic events through data attributes via HTML markup
JavaScript
27
star
12

ofxTVI

Touch Vision Interface client addon for openFrameworks
C++
25
star
13

node-carrot2

Carrot2 Document Clustering Server implementation for Node.js
JavaScript
16
star
14

iOS-8-GUI-for-Sketch-iPhone-6

A Sketch file of GUI elements found in the public release of iOS 8.
12
star
15

iOS-8-GUI-PSD-iPhone-6

A Photoshop template of GUI elements found in the public release of iOS 8.
8
star
16

iPad-GUI-for-Sketch-iOS-7

A Sketch file of GUI elements found in the public release of iOS 7.
3
star
17

iPhone-GUI-for-Sketch-iOS-7

A Sketch file of GUI elements found in the public release of iOS 7.
2
star
18

iPad-GUI-PSD-iOS-7

This Photoshop template contains all the major iOS elements to help you design your app.
1
star