UIPasteboard 类
The UIPasteboard class enables an app to share data within the app and with another app. To share data with any other app, you can use system-wide pasteboards; to share data with another app that has the same team ID as your app, you can use app-specific pasteboards. |
1 实例方法
+ (UIPasteboard *)generalPasteboard;
+ (UIPasteboard *)pasteboardWithName:(NSString *)pasteboardName create:(BOOL)create;
+ (UIPasteboard *)pasteboardWithUniqueName;
2 表示可复制的内容的属性
@property(nonatomic,copy) NSString *string;
@property(nonatomic,copy) NSArray *strings;
@property(nonatomic,copy) NSURL *URL;
@property(nonatomic,copy) NSArray *URLs;
@property(nonatomic,copy) UIImage *image;
@property(nonatomic,copy) NSArray *images;
@property(nonatomic,copy) UIColor *color;
@property(nonatomic,copy) NSArray *colors;
//复制string 将字符串复制到的系统的粘贴板上 在其它地方可以粘贴
- (void)copyToPasteBoard:(NSString *)str{
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setString:str];
}