Pasteboard - copying (image) creates mystery \n line break in custom keyboard

281 views Asked by At

When I add an image to the pasteboard I get a line break at the end of my image?

its my code

 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
 NSData *data= UIImagePNGRepresentation([UIImage imageNamed:@"2.png"]);
            [pasteboard setData:data forPasteboardType:@"public.png"];

this code successfully paste image from Pasteboard, but image come with extra line break(after next to image). If I just copy the text it does not add a mysterious line-break.

if can anyone think of some nice solution then please share with me. Thanks in advance.....

0

There are 0 answers