In my ViewController
I have three views.
I want to add UIPanGestureRecognizer
in this.
Below is my code...
var circlePanGesture = UIPanGestureRecognizer()
var sqaurePanGesture = UIPanGestureRecognizer()
var trianglePanGesture = UIPanGestureRecognizer()
var destination = [UIView]()
@IBOutlet weak var circle_source: UIView!
@IBOutlet weak var square_source: UIView!
@IBOutlet weak var triangle_source: UIView!
override func viewDidLoad() {
super.viewDidLoad()
panGestureConfiguration()
}
func UIConfiguration() {
circle_source.layer.cornerRadius = circle_source.frame.size.width/2
circle_source.clipsToBounds = true
}
func panGestureConfiguration() {
circlePanGesture.addTarget(self, action: #selector(draggedSourceView(_:)))
circle_source.addGestureRecognizer(circlePanGesture)
sqaurePanGesture.addTarget(self, action: #selector(draggedSourceView(_:)))
square_source.addGestureRecognizer(sqaurePanGesture)
trianglePanGesture.addTarget(self, action: #selector(draggedSourceView(_:)))
triangle_source.addGestureRecognizer(trianglePanGesture)
}
In this ViewController's panGestureConfiguration
function I want to use only one UIPanGestureRecognizer
object instead of three. So how to do it?
Please give me any solution for this.