Albert Renshaw
Albert Renshaw

Reputation: 17892

iOS copy multiple images to pasteboard

I can copy one image to the pasteboard like so:

UIPasteboard *pasteboard;
pasteboard = [UIPasteboard generalPasteboard];
UIImage *image;
[pasteboard setImage:image];

How can I copy two or three images to the pasteboard?

Upvotes: 2

Views: 2216

Answers (1)

Ryan Crews
Ryan Crews

Reputation: 3033

[[UIPasteboard generalPasteboard] setImages:[NSArray arrayWithObjects:firstImage, secondImage, nil]];

I think this is all you're looking for. It is also possible to set a single image with multiple types (PNG, JPG, etc.) so that it is more likely that another application will find a usable image.

~ Good Luck

Upvotes: 5

Related Questions