Latest 1.0
Homepage https://github.com/mdznr/MTZTiltReflectionSlider
License BSD 3-Clause License
Platforms ios , requires ARC
Frameworks CoreMotion, QuartzCore
Authors

A UISlider subclass mimicking and improving the tilt controlled slider added to Music.app in iOS 6

The knob changes it’s lighting reflection based on the motion of the device.

Examples:

![Example 1](README Images/Example 1.png)
![Example 2](README Images/Example 2.png)

================================

How To Use:

You can add this UI element programmatically or with Interface Builder.

I show how to add this in Interface Builder in steps 1 and 2.

  1. Drag a UISlider from the Object Library (bottom part of Utilities panel).
    ![UISlider in Object Library](README Images/Object Library.png)

  2. Change class from default to custom class MTZTiltReflectionSlider.
    ![Custom class](README Images/Custom Class.png)

  3. Add the CoreMotion Framework to your project
    ![Add CoreMotion Framework](README Images/Add CoreMotion Framework.png)

  4. Be sure to #import "MTZTiltReflectionSlider.h" in your UIViewController subclass

  5. Set the size of the knob

    Small: 32px (MTZTiltReflectionSliderSizeSmall)

    Regular: 48px (MTZTiltReflectionSliderSizeRegular)

    [_mySlider setSize:MTZTiltReflectionSliderSizeSmall]

    If no size is set, it defaults to regular size (48px)

  6. Tell the slider to start motion updates when needed and stop when not needed

    In your UIViewController subclass:

    - (void)viewWillAppear:(BOOL)animated
    {
        [_mySlider startMotionDetection];
    }
    
    - (void)viewWillDisappear:(BOOL)animated
    {
        [_mySlider stopMotionDetection];
    }

Latest podspec

{
    "name": "MTZTiltReflectionSlider",
    "version": "1.0",
    "summary": "UISlider subclass mimicking and improving the tilt controlled slider added to Music.app in iOS 6.",
    "homepage": "https://github.com/mdznr/MTZTiltReflectionSlider",
    "license": {
        "type": "BSD 3-Clause License",
        "file": "LICENSE.txt"
    },
    "authors": {
        "Matt Zanchelli": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mdznr/MTZTiltReflectionSlider.git",
        "tag": "Release1.0"
    },
    "platforms": {
        "ios": null
    },
    "source_files": "MTZTiltReflectionSlider/*.{h,m}",
    "exclude_files": [
        "MTZTiltReflectionSlider_Example*",
        "README Images"
    ],
    "resources": "MTZTiltReflectionSlider/*.png",
    "frameworks": [
        "CoreMotion",
        "QuartzCore"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This