RCDraggableButton 0.4

RCDraggableButton 0.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Looping.



  • By
  • Looping

License MIT

A draggable button that appears in your view.

RCDraggableButton Screenshot1 RCDraggableButton Screenshot2 RCDraggableButton Screenshot3 RCDraggableButton Screenshot4 RCDraggableButton Screenshot5 RCDraggableButton Screenshot6

Note

RCDraggableButton is not ready for production use until version 1.0.

Requirements

  • Xcode 5.0 or higher
  • iOS 5.0 or higher
  • ARC

Demo

In your terminal,

cd [projdir]/RCDraggableButtonDemo
pod install

After a cup of tea, you should be able to build and run the RCDraggableButtonDemo project by open RCDraggableButtonDemo.xcworkspace in Xcode5.

open RCDraggableButtonDemo.xcworkspace

Installation

Manual Install

All you need to do is drop Src files into your project, and add #include "RCDraggableButton.h" to the top of classes that will use it.

Example Usage

In your AppViewController's - (void)viewDidLoad create draggableButton and add it to keyWindow or customView.

// Set view as nil, means add button to keyWindow
    RCDraggableButton *draggableButton = [[RCDraggableButton alloc] initInView:nil WithFrame:CGRectMake(120, 120, 60, 60)];

// Or add button to customView that you set in -init method
    UIView *customView = ...;
    [self.view addSubview:customView];

    RCDraggableButton *avatar = [[RCDraggableButton alloc] initInView:customView WithFrame:CGRectMake(120, 120, 60, 60)];

You can also use it manually:

    RCDraggableButton *draggableButton = [[RCDraggableButton alloc] initWithFrame:CGRectMake(0, 100, 60, 60)];
    [self.view addSubview:draggableButton];

For more usage example, please look up the demo project in RCDraggableButtonDemo, or the source files in Src.

License

RCDraggableButton is available under the MIT license. See the LICENSE file for more info.