Skip to content

roamtouch/gesturekit-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS Addon

An iOS static library to recognize advanced gestures on iOS apps.


Compatibility

  • Any device that supports iOS 6+

##Usage


1- Import the GestureKit static library into your project.

  • Download [URL] unzip it and drag and drop the folder into your project.
  • Select “copy items into…” option.
  • Add “-ObjC” to “Other linker flags”.

2- Instance a GestureKit object.

Import GestureKit.h and instantiate it using your keyWindow and your GestureKit GID. A good place to do this is on you Application Delegate.

#import "GestureKit.h"
...
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
[GestureKit runInWindow:self.window withGID:@”YOUR_GK_GID”];
}

3- Setup GestureKit.

You should declare on your AppDelegate a method with the same name of the defined GestureKit method. For example, you define the "PLAY" action, then you should declare:

(void) PLAY{
...
}
(void) PLAY:(NSString*) metadata{
...
}

In case you care about the metadata associated to the gesture.


4- Customizing GKVisor [optional].

GestureKit has a default visor called GestureKitVisor, it's responsible of show GestureKit status as loading, drawing gestures, ready and warning.

It can be replaced by your own Visor just implementing GK_VisorProtocol and then instantiating the GestureKit object with it’s alternative methods:

(void) runInWindow:(UIWindow*) window withGID:(NSString*) gid withVisor:(id<GK_VisorProtocol>) visor;

The protocol is available on “GestureKit.h” and it’s the following:

//Protocol for implementing custom visors
@protocol GK_VisorProtocol <NSObject>

@required

//To draw the gesture in your visor
- (void) touchEvent:(NSInteger) pointID beganFromPoint:(CGPoint) point;
- (void) touchEvent:(NSInteger) pointID movedToPoint:(CGPoint) point;
- (void) touchEvent:(NSInteger) pointID endedAtPoint:(CGPoint) point;

//For showing the status of the addon to the end user.
- (void) showStaticLogo;
- (void) showErrorLogo;
- (void) showLoadingLogo;

@end

touchEvent:beganFromPoint:, touchEvent:movedToPoint: and touchEvent:endedAtPoint: Are for handling the drawing of the touches on the device, each touch/finger is has an touchID associated for grouping purposes.

showErrorLogo method is called after an error or warning are occured. For example, if you are offline or your GID is not valid.

showLoadingLogo method is called while a background process is executing. For example when GestueKit is downloading data.

showOkLogo method is called every time GestureKit is ready.

Maintained by

  • Julio Carrettoni ()
  • Twitter: @dev_jac

Credits

RoamTouch logo

License

Licensed under Apache v2 License.

Copyright (c) 2014 RoamTouch.

About

An iOS static library to recognize advanced gestures on iOS apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •