Will a generic iPhone cardboard ever contain more than one item?

Will there be pasteboard.numberOfItems(in the code below) greater than 1? How can a user invoke this?

UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
pasteBoard.numberOfItems

Please note that I am not asking if a single cardboard element can have more than one type of presentation. It is clear.

Update . I understand that programmatically it would be possible to add several elements to the cardboard (using addItems as Kevin Ballard or by setting the items property in an array containing more than one dictionary). But can the user do this using any of the built-in applications? I believe that it would be easy to write an application that added several elements to a file cabinet (therefore, for my application it should be reliable, it should handle this situation).

+3
source share
3 answers

The built-in "Photos" application allows you to place several photos on a common file cabinet. Just use the "Share" button, select some photos and click "Copy".

A common cardboard will have each photo as an element with two views: "public.jpeg" and "public.utf8-plain-text". The second view (text) is apparently the file name, however, in this case, the photos always return the “image” plus a sequential number (that is, image1.jpg, image2.jpg, etc.).

, ( ), . .

+2

-addItems: UIPboardboard, , , , , .

+4

Apple. , .

EDIT: The second time, maybe several times, several instances when testing my application, but I did not determine where it came from, or this is an Apple application. In any case, I would write a test for him. My application - right now - looks only at the first element, and I have never had problems with embedded applications when testing.

+3
source

Source: https://habr.com/ru/post/1713603/


All Articles