- In pod file uncomment use_frameworks! line, update pod, then build project
- Import 'YLLongTapShare' module in view controller
- Write rest of code:)
Simple example:
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
}
}