Open sourced RCTPasteboard

Summary: public

RCTPasteboard is a very basic API for writing strings to the pasteboard. Useful for implementing "copy to clipboard" functionality.

Reviewed By: astreet

Differential Revision: D2663875

fb-gh-sync-id: 8d0ecd824c3e9fe135b02201d21d0dab1907c329
This commit is contained in:
Nick Lockwood
2015-11-17 15:16:16 -08:00
committed by facebook-github-bot-6
parent 3c5f3b1dfc
commit 26cb6bef15
5 changed files with 54 additions and 6 deletions

View File

@@ -7,8 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTPointAnnotation.h"
#import "RCTBridgeModule.h"
@implementation RCTPointAnnotation
@interface RCTPasteboard : NSObject <RCTBridgeModule>
@end

View File

@@ -7,13 +7,22 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <MapKit/MapKit.h>
#import "RCTPasteboard.h"
@interface RCTPointAnnotation : MKPointAnnotation <MKAnnotation>
#import <UIKit/UIKit.h>
@property (nonatomic, copy) NSString *identifier;
@property (nonatomic, assign) BOOL hasLeftCallout;
@property (nonatomic, assign) BOOL hasRightCallout;
@property (nonatomic, assign) BOOL animateDrop;
@implementation RCTPasteboard
RCT_EXPORT_MODULE()
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
RCT_EXPORT_METHOD(setPasteboardString:(NSString *)string)
{
[[UIPasteboard generalPasteboard] setString:string];
}
@end