• <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 将文本复制到剪贴板

      Copy text to clipboard with iOS(使用 iOS 将文本复制到剪贴板)
      <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 将文本复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                what#39;s property copy means in Cocoa#39;s Framework?(like UITabBar#39;s items property)(Cocoa 框架中的属性副本是什么意思?(如 UITabBar 的 items 属性))
                Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                WebKit on th iPhone: is it possible to copy text to the clipboad with JavaScript(iPhone上的WebKit:是否可以使用JavaScript将文本复制到剪贴板)
                Difference between retain and copy?(保留和复制的区别?)
                Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)

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

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

                    • <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>
                      • <tfoot id='g1AWf'></tfoot>
                          <tbody id='g1AWf'></tbody>
                          <legend id='g1AWf'><style id='g1AWf'><dir id='g1AWf'><q id='g1AWf'></q></dir></style></legend>