react-native/ReactKit/Base/RCTEventDispatcher.h
Christopher Chedeau fd8b7dee77 2015-02-04 updates
- Unbreak ReactKit | Nick Lockwood
- Refactor | Nick Lockwood
- [ReactNative] fix touch cancel behavior | Spencer Ahrens
- [ReactNative iOS] Fix responder issue with textInput | Eric Vicenti
- [ReactNative] README updates - file watching troubleshooting, one-time code drop -> currently private repo | Spencer Ahrens
- [ReactKit] Re-add README linebreaks | Ben Alpert
2015-02-06 15:43:59 -08:00

52 lines
1.3 KiB
Objective-C

// Copyright 2004-present Facebook. All Rights Reserved.
#import <UIKit/UIKit.h>
@class RCTBridge;
typedef NS_ENUM(NSInteger, RCTTextEventType) {
RCTTextEventTypeFocus,
RCTTextEventTypeBlur,
RCTTextEventTypeChange,
RCTTextEventTypeSubmit,
RCTTextEventTypeEnd
};
typedef NS_ENUM(NSInteger, RCTScrollEventType) {
RCTScrollEventTypeStart,
RCTScrollEventTypeMove,
RCTScrollEventTypeEnd,
RCTScrollEventTypeStartDeceleration,
RCTScrollEventTypeEndDeceleration,
RCTScrollEventTypeEndAnimation,
};
@interface RCTEventDispatcher : NSObject
- (instancetype)initWithBridge:(RCTBridge *)bridge;
/**
* Send a named event. For most purposes, use the an
* event type of RCTEventTypeDefault, the other types
* are used internally by the React framework.
*/
- (void)sendEventWithName:(NSString *)name body:(NSDictionary *)body;
/**
* Send text events
*/
- (void)sendTextEventWithType:(RCTTextEventType)type
reactTag:(NSNumber *)reactTag
text:(NSString *)text;
/**
* Send scroll events
* (You can send a fake scroll event by passing nil for scrollView)
*/
- (void)sendScrollEventWithType:(RCTScrollEventType)type
reactTag:(NSNumber *)reactTag
scrollView:(UIScrollView *)scrollView
userData:(NSDictionary *)userData;
@end