mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-27 22:54:46 +08:00
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:
committed by
facebook-github-bot-6
parent
3c5f3b1dfc
commit
26cb6bef15
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user