UILabel与UIMenuController - 在UIPasteboard中复制文本

时间:2017-07-24 11:09:03

标签: ios swift uilabel uimenucontroller uipasteboard

我有一个protected function get_id() { $product_id = $_GET['product_id']; $product = get_post( $product_id ); if ( empty( $product ) ) { // Time to 404. $error_page = get_404_template(); header("HTTP/1.0 404 Not Found"); include($error_page); // neither works get_template_part('404'); die(); } else { $this->product_id = $product_id; } } 文字“这是带有UILable的标签”。我已在标签上添加UIMenuController并从中打开UILongPressGesture

菜单控制器将UIMenuController的框架视为源视图(因为它是它的自然行为),但我希望UILabel上的特定单词应该成为UILable的源点并将相同的单词复制到{ {1}}区域。

即:如果我点击/按下UIMenuController框架中的“标签”字样,则UIPaseBoard的来源点应为“标签”字样,并且应将其复制到UILabel

我怎样才能做到这一点。

提示:
我访问了这个问题,它考虑了UILabel的全文,我需要用户点击的特定文本范围(长按)
Show iPhone cut copy paste menu on UILabel

这是ref,snapshot。

enter image description here

0 个答案:

没有答案