iOS UIPasteboard

In this tutorial, we’ll be discussing and implementing the UIPasteboard class in our iOS Application.

在本教程中,我们将在iOS应用程序中讨论和实现UIPasteboard类。

UIPasteboard (UIPasteboard)

The UIPasteboard class provides a clipboard and is used to share data within the app and from one application to the other.

UIPasteboard类提供一个剪贴板,用于在应用程序内以及一个应用程序与另一个应用程序之间共享数据。

Using a UIPasteboard, you can copy paste text, url, images and other data types. UIPasteboard has a system-wide clipboard which holds the data you’ve copied.

使用UIPasteboard,您可以复制粘贴的文本,URL,图像和其他数据类型。 UIPasteboard有一个系统范围的剪贴板,用于保存您复制的数据。

Following are the important helper properties and functions of a UIPasteboard:

以下是UIPasteboard的重要帮助程序属性和功能:

general property is used to retrieve the system-wide UIPasteboard.

general属性用于检索系统范围的UIPasteboard。

let pasteboard = UIPasteboard.general

Creating your own Named Pasteboard:

创建自己的命名粘贴板:

let pasteboard = UIPasteboard.init(name: UIPasteboard.Name(rawValue: "pasteboard_name"), create: true)

Inside the init method, we pass two arguments: name and create.
Using the above statement we can retrieve the same named Pasteboard.

init方法内部,我们传递了两个参数: namecreate
使用上面的语句,我们可以检索相同名称的Pasteboard。

The create argument requires a Bool value. If it is set as true, then the Pasteboard would be created if it doesn’t exist already.

create参数需要一个Bool值。 如果将其设置为true,则将创建粘贴面板(如果尚不存在)。

UIPasteboard.withUniqueName() returns a unique UIPasteboard. This returns a Pasteboard which is visible in all your apps having the same APP ID.

UIPasteboard.withUniqueName()返回唯一的UIPasteboard。 这

你可能感兴趣的:(python,java,大数据,vue,mysql,ViewUI)