uipasteboard

Testing that a particular image was copied to pasteboard

半腔热情 提交于 2019-12-24 17:57:06
问题 I'm writing a test to verify a feature which copies an image to the pasteboard. Here's the test, as I would prefer to write it: // reset the paste board UIPasteboard.generalPasteboard.image = nil; //<-- this explodes XCTAssertNil(UIPasteboard.generalPasteboard.image); // Grab some random existing image UIImage *image = [UIImage imageNamed:@"some-image"]; MJKMyClass *myInstance = [[myInstance alloc] initWithImage:image]; [myInstance doSomethingThatCopiesImageToPasteboard] XCTAssertNotNil

I want native iOS copy and paste UI on UILabel

ぃ、小莉子 提交于 2019-12-23 16:22:47
问题 I want to create the native Copy and Paste experience that iOS provides when you tap and hold a UITextField - but I want it to work on a UILabel instead of a UITextField . Is this possible, or is it something that only works with UITextField ? Would I need to create my own custom UI and mess around in UIPasteboard or is there a more eloquent solution? Here is a typical example, although it normally also shows the zoomed in circle: 回答1: It is difficult to do the standard copy menu on the label

Pasteboard UIImage not using scale

一个人想着一个人 提交于 2019-12-22 17:49:58
问题 I am building a custom keyboard and am having trouble adding an image to the pasteboard and maintaining the appropriate scale and resolution with in the pasted image. Let me start with a screenshot of the keyboard to illustrate my trouble: So the picture of the face in the top left of the keyboard is just a UIButton with the original photo set to the background. When the button is pressed the image is resized with the following function: func imageResize(image:UIImage, size:CGSize)-> UIImage

UIPasteboard string returning null from Today extension

时间秒杀一切 提交于 2019-12-22 08:53:20
问题 It seems that in iOS 9/Xcode 7 beta 5, I am unable to access [[UIPasteboard generalPasteboard] string]; from my Today widget extension as every time no matter the contents, it returns (NULL). I looked through the release notes and I did not see anything regarding this. Any ideas? 回答1: It seems to be an undocumented bug with iOS 9 beta 5, in particular, the iOS runtime. Same code works with normal app on iOS 9 beta 5, and today widget in iOS 8.x devices. 回答2: My app, which is a password

How do I send audio file send via iMessage ios 8

别来无恙 提交于 2019-12-22 07:15:08
问题 As we know with the launch of ios 8 the apple allow custom Keyboard extension.In keyboard extension we can send images,gif etc in SMS by using Copy image to clipboard.code UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; NSData *data= UIImagePNGRepresentation([UIImage imageNamed:@"so_close_disappointed_meme.png"]); [pasteboard setData:data forPasteboardType:@"public.png"]; Now i am trying to send audio file in iMessage like this feature reference.don't know apple will allow us to

Want to copy a gif image from my app to the in-app mail window. How do i do that?

南笙酒味 提交于 2019-12-21 05:43:11
问题 I am having some confusion here... how do i display gif for my iPhone app? (I mean there are various articles which i found, but every tutorial just didn't have a complete solution) There are many solutions between which i am confused. Should i split gif into different frames using an online tool and then display it in UIImageView using animation? Or should i display gif into a UIWebview? Or should i use this article? http://blog.stijnspijker.nl/2009/07/animated-and-transparent-gifs-for

Grabbing the UIPasteboard like Pastebot while running in the background

Deadly 提交于 2019-12-21 05:34:15
问题 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

Storing NSArray in UIPasteboard

青春壹個敷衍的年華 提交于 2019-12-19 07:35:49
问题 I have several text files which I want to transfer between 2 Apps. (ie. free and paid versions of the same App). I'm using UIPasteboard to do this. The contents of the files are held in memory as NSArrays, and so I want to copy these NSArrays to the pasteboard (lite version), and read them from the pasteboard (full version). For some reason the data cannot be read back from the pasteboard. The data is being returned as a NSData object, rather than NSArray, which I think means that it is not

Storing NSArray in UIPasteboard

断了今生、忘了曾经 提交于 2019-12-19 07:35:22
问题 I have several text files which I want to transfer between 2 Apps. (ie. free and paid versions of the same App). I'm using UIPasteboard to do this. The contents of the files are held in memory as NSArrays, and so I want to copy these NSArrays to the pasteboard (lite version), and read them from the pasteboard (full version). For some reason the data cannot be read back from the pasteboard. The data is being returned as a NSData object, rather than NSArray, which I think means that it is not

copy HTML to UIPasteboard

喜夏-厌秋 提交于 2019-12-19 04:09:08
问题 I want to transfer HTML from my app to the iPhone mail application. I already have the HTML text - lest say &LT;span style='color:red'>Test&LT;/span> I can place this to UIPasteBoard - but when I paste it to mail I get the html source. When I place the same string in a HTMLView - select it there and copy it it pastes as red text in mail. What do I have to do to place the string in the UIPasteBoard so that it pastes as red text to the mail application? I've been searching for "format types" -