I recently saw this project in which the user can use GIFs from the user keyboard, and they would see a โcopiedโ toolbar. I have one question:
Can someone give me some sample code to work. I understand how to use UIPastboard, and it works, but I canโt get it to work when I add the public.png type to UTI in this function: (I noticed in "Objective-c it" @ public.png ", but I put "public.png", I could not find a source on the Internet for this)
let imageURL = NSString(string:NSBundle.mainBundle().pathForResource("test", ofType: "png")!) var data = NSData(contentsOfURL: NSURL(string:imageURL)!) UIPasteboard.generalPasteboard().setData(data!, forPasteboardType: "public.png")
source share