GithubHelp home page GithubHelp logo

syswarren / mntpulltoreact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mentionapp/mntpulltoreact

0.0 0.0 0.0 165 KB

One gesture, many actions. An evolution of Pull to Refresh.

License: Apache License 2.0

mntpulltoreact's Introduction

MNTPullToReact

MNTPullToReact is a kind of extension of the famous interaction pull to refresh. The main idea comes from an unique question: Is that the natural pulling gesture can make more and so avoid ugly action buttons that take the precious place to the content.

You can bind as many reaction as you want to a MNTPullToReact and have your user access your application specific actions through an unique and well known gesture.

MNTPullToReact is very easy to use and highly customizable.

Easy to use

It is a subclass of an UIControl and embrace the common target-action design pattern widely used in the Apple own controls. It mimics also the Apple UIRefreshControl control interface to facilitate its usage by developers who already use the Apple pull to refresh control.

What UIRefreshControl MNTPullToReact
Property to know the status BOOL refreshing NSInteger action
Initiate an action beginRefreshing beginAction:
Terminate an action endRefreshing endAction:
Event on action needed UIControlEventValueChanged UIControlEventValueChanged

Shortest code sample

The shortest code sample use the MNTPullToReactDefaultView. For instance the code below create a pull to react with 4 actions.

// Import the library header
#import "PullToReact.h"

// In the viewDidLoad create the control
MNTPullToReactControl *reactControl = [[MNTPullToReactControl alloc] initWithNumberOfActions:4];
[reactControl addTarget:self action:@selector(reaction:) forControlEvents:UIControlEventValueChanged];
self.tableView.reactControl = reactControl;

// Than create the target-action method
- (void)reaction:(id)sender
{
    // Do the reaction thing
    [reactControl endAction:reactControl.action];
}

Highly customizable

You can customize your pull to react without any limit by subclassing the MNTPullToReactView class.

mntpulltoreact's People

Contributors

gsempe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.