uipasteboard

iOS - UIPasteboard not working outside app

牧云@^-^@ 提交于 2019-12-04 06:19:53
I think this is more of an SDK flaw than my apps' but recently I've been trying to use UIPasteboard to copy strings from my app and it works fine to pasting somewhere when I'm inside the app. When I jump to another app by either pressing the home button or anything like that, I simply don't have the option to paste the copied content. UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; [pasteboard setString: @"blah" ]; NSLog(@"%@", pasteboard.string); It will print "blah" in this case, and whenever I quick touch a textfield, it will show the paste option. But if I go to Safari, Notes

Grabbing the UIPasteboard like Pastebot while running in the background

穿精又带淫゛_ 提交于 2019-12-03 17:16:09
I know this is possible as Tapbots Pastebot does this. I am trying to grab the UIPasteboard when my iPhone app is running in the background and add it to a UITableView just as Pastebot does but I am also trying to shorten the link, if its a URL and copy that back to the UIPastboard so its ready for the user to paste anywhere. Now Pastebot apparently runs in the background by playing an audio file for 10 minutes. I have set up the NSNotificationCenter like so in the applicationDidFinishLaunching [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector

Receiving UIPasteboard (generalPasteboard) notification while in the background

眉间皱痕 提交于 2019-12-03 17:02:37
问题 In there a way to do this? I register my object for UIPasteboardChangedNotification at launch time, but when sending it to the background and opening (for instance) Safari and copying some text, my handler never gets called. (I'm using just the simulator for now). I've used both: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pasteboardNotificationReceived:) name:UIPasteboardChangedNotification object:[UIPasteboard generalPasteboard]]; and: [[NSNotificationCenter

How to write custom metadata to PNG images in iOS

こ雲淡風輕ζ 提交于 2019-12-03 16:36:27
问题 My application should be able to write custom metadata entries to PNG images for export to the UIPasteboard. By piecing together various posts on the subject, I've been able to come up with the class given below as source. Triggering the copyPressed method with a button, I'm able to set custom metadata with JPG images (EXIF): Image[6101:907] found jpg exif dictionary Image[6101:907] checking image metadata on clipboard Image[6101:907] { ColorModel = RGB; Depth = 8; Orientation = 1;

How can I get the standard iPhone Copy bubble to appear on a UIImage?

拟墨画扇 提交于 2019-12-03 13:34:16
问题 In iPhoto, I can simply hold my finger over an image to get a "Copy" popup (like the popup you see in text boxes). In my UIImageView's, this is not the case. How can I enable it? 回答1: You can manually display the Cut / Copy / Paste menu using the UIMenuController class. For example, the following code will display the menu, centered on your image: [self becomeFirstResponder]; UIMenuController *copyMenuController = [UIMenuController sharedMenuController]; [copyMenuController setTargetRect

Copy Image with UIPasteBoard (Swift)

孤街醉人 提交于 2019-12-03 10:58:32
问题 I recently saw this project in which a user can tap on a GIF from a custom keyboard and they would see a "copied" toolip appear. I have one question: How does one reproduce this tooltip in the products GIF-Tutorial? Could anyone give me some sample code to work with. I understand how to use UIPasteboard and it's functions, but I can't seem to get it to work when I put in the UTI type "public.png" in this function: (I noticed in Objective-c it's "@public.png", but I placed "public.png" I

Copy functionality in iOS by using UIPasteboard

风格不统一 提交于 2019-12-03 06:28:33
问题 NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]]; UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:copyStringverse]; I am using above code for copying contents in textview ,but I want to copy contents in a cell of the table. How to do this. Thanks in advance. 回答1: Well you don't say exactly how you have your table view cell set up, but if it's just text inside your table view it could be as easy as: // provided you actually have your table

Receiving UIPasteboard (generalPasteboard) notification while in the background

*爱你&永不变心* 提交于 2019-12-03 06:04:55
In there a way to do this? I register my object for UIPasteboardChangedNotification at launch time, but when sending it to the background and opening (for instance) Safari and copying some text, my handler never gets called. (I'm using just the simulator for now). I've used both: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pasteboardNotificationReceived:) name:UIPasteboardChangedNotification object:[UIPasteboard generalPasteboard]]; and: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pasteboardNotificationReceived:) name

How to write custom metadata to PNG images in iOS

丶灬走出姿态 提交于 2019-12-03 05:56:24
My application should be able to write custom metadata entries to PNG images for export to the UIPasteboard. By piecing together various posts on the subject, I've been able to come up with the class given below as source. Triggering the copyPressed method with a button, I'm able to set custom metadata with JPG images (EXIF): Image[6101:907] found jpg exif dictionary Image[6101:907] checking image metadata on clipboard Image[6101:907] { ColorModel = RGB; Depth = 8; Orientation = 1; PixelHeight = 224; PixelWidth = 240; "{Exif}" = { ColorSpace = 1; PixelXDimension = 240; PixelYDimension = 224;

How can I get the standard iPhone Copy bubble to appear on a UIImage?

人盡茶涼 提交于 2019-12-03 03:29:19
In iPhoto, I can simply hold my finger over an image to get a "Copy" popup (like the popup you see in text boxes). In my UIImageView's, this is not the case. How can I enable it? Brad Larson You can manually display the Cut / Copy / Paste menu using the UIMenuController class . For example, the following code will display the menu, centered on your image: [self becomeFirstResponder]; UIMenuController *copyMenuController = [UIMenuController sharedMenuController]; [copyMenuController setTargetRect:image.frame inView:self.view]; [copyMenuController setMenuVisible:YES animated:YES]; This assumes