• <bdo id='z90vm'></bdo><ul id='z90vm'></ul>
      <legend id='z90vm'><style id='z90vm'><dir id='z90vm'><q id='z90vm'></q></dir></style></legend>
    1. <small id='z90vm'></small><noframes id='z90vm'>

    2. <tfoot id='z90vm'></tfoot>
      <i id='z90vm'><tr id='z90vm'><dt id='z90vm'><q id='z90vm'><span id='z90vm'><b id='z90vm'><form id='z90vm'><ins id='z90vm'></ins><ul id='z90vm'></ul><sub id='z90vm'></sub></form><legend id='z90vm'></legend><bdo id='z90vm'><pre id='z90vm'><center id='z90vm'></center></pre></bdo></b><th id='z90vm'></th></span></q></dt></tr></i><div id='z90vm'><tfoot id='z90vm'></tfoot><dl id='z90vm'><fieldset id='z90vm'></fieldset></dl></div>

      使用 iOS 将文本复制到剪贴板

      时间:2024-04-15
      <i id='qmerL'><tr id='qmerL'><dt id='qmerL'><q id='qmerL'><span id='qmerL'><b id='qmerL'><form id='qmerL'><ins id='qmerL'></ins><ul id='qmerL'></ul><sub id='qmerL'></sub></form><legend id='qmerL'></legend><bdo id='qmerL'><pre id='qmerL'><center id='qmerL'></center></pre></bdo></b><th id='qmerL'></th></span></q></dt></tr></i><div id='qmerL'><tfoot id='qmerL'></tfoot><dl id='qmerL'><fieldset id='qmerL'></fieldset></dl></div>
        <bdo id='qmerL'></bdo><ul id='qmerL'></ul>

          <legend id='qmerL'><style id='qmerL'><dir id='qmerL'><q id='qmerL'></q></dir></style></legend>

            1. <small id='qmerL'></small><noframes id='qmerL'>

                <tbody id='qmerL'></tbody>
              • <tfoot id='qmerL'></tfoot>
                本文介绍了使用 iOS 将文本复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在您的应用程序中将文本复制到 iPhone 剪贴板的最佳方法是什么?

                What is the best way to copy text to the iPhone's clipboard in your application?

                他们的文档很粗略,而且功能比我想要的要多...我只想设置一个字符串作为用户剪贴板.

                Their docs are sketchy and have way more features than what I want... I just want to set a string as the users clipboard.

                推荐答案

                虽然接受的答案是 UIPasteboard 工作原理的一个很好的演练,但我想我会在这里为大家发布相关的片段方便:

                Although the accepted answer is a good walkthrough of how UIPasteboard works, I figured I'd post the relevant snippet right here for everyone's convenience:

                Obj-C

                UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
                pasteboard.string = @"Paste me!";
                

                斯威夫特 2.2

                let pasteBoard = UIPasteboard.generalPasteboard()
                pasteBoard.string = "Paste me!"
                

                斯威夫特 3+:

                let pasteBoard = UIPasteboard.general
                pasteBoard.string = "Paste me!"
                

                这篇关于使用 iOS 将文本复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Swift - 迭代结构对象时如何对其进行变异 下一篇:Android将图像从图库文件夹复制到SD卡替代文件夹

                相关文章

                <small id='g1AWf'></small><noframes id='g1AWf'>

                  • <bdo id='g1AWf'></bdo><ul id='g1AWf'></ul>

                1. <i id='g1AWf'><tr id='g1AWf'><dt id='g1AWf'><q id='g1AWf'><span id='g1AWf'><b id='g1AWf'><form id='g1AWf'><ins id='g1AWf'></ins><ul id='g1AWf'></ul><sub id='g1AWf'></sub></form><legend id='g1AWf'></legend><bdo id='g1AWf'><pre id='g1AWf'><center id='g1AWf'></center></pre></bdo></b><th id='g1AWf'></th></span></q></dt></tr></i><div id='g1AWf'><tfoot id='g1AWf'></tfoot><dl id='g1AWf'><fieldset id='g1AWf'></fieldset></dl></div>
                2. <tfoot id='g1AWf'></tfoot>
                    <legend id='g1AWf'><style id='g1AWf'><dir id='g1AWf'><q id='g1AWf'></q></dir></style></legend>