我想截取这个pod长按的值:
https://github.com/liyong03/YLLongTapShare
objective-c - Swift Long新闻结果-LMLPHP
我在Swift中开发,这个pod只是Objective-C。
我无法捕捉到处理长新闻选择结束的func(这里,在屏幕截图上),我想在用户发布长新闻后检索“Twitter”(他的选择是Twitter)
提前谢谢!

最佳答案

在pod文件中取消注释使用框架!行,更新pod,然后构建项目
在视图控制器中导入“YLLongTapShare”模块
编写其余代码:)
简单示例:

import UIKit
import YLLongTapShare
class TestViewController: UIViewController, YLLongTapShareDelegate {
    @IBOutlet weak var tapShareView: YLLongTapShareView!


override func viewDidLoad() {
    super.viewDidLoad()
    self.tapShareView.delegate = self;
    self.tapShareView.add(YLShareItem(icon: UIImage(named: "test1"), andTitle: "test1"))
    self.tapShareView.add(YLShareItem(icon: UIImage(named: "test2"), andTitle: "test2"))
    self.tapShareView.add(YLShareItem(icon: UIImage(named: "test3"), andTitle: "test3"))
}

func longTapShare(_ view: UIView!, didSelectShareTo item: YLShareItem!, with index: UInt) {
    print("longTapShare \(item.title)")
}

func colorOfShareView() -> UIColor! {
    return UIColor.red
}

}

10-08 05:54