Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

looping/RCDraggableButton

Repository files navigation

RCDraggableButton

License MIT Build Platform Build Version Build Status RCDraggableButton Chat Stories in Ready

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

CocoaPods

The recommended approach for installating RCDraggableButton is via the CocoaPods package manager.

In your Podfile, add a line shows below:

pod 'RCDraggableButton', '~> 0.1'

Then,

pod update

If you haven't used CocoaPods before, you should visit CocoaPods for more info.

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.