I have no idea about the following situation:
I had exported a NSObject
from PaintCode and made a .swift file (someObject.swift).
public class PlanATrip: NSObject {
class func drawRectangle1(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 200, height:100), resizing: ResizingBehavior = .aspectFit) {
....
}
I also overrode the draw()
function in a UIView
(someObjectView.swift).
So how can add a gesture recognizer to a bezierPath (for example, a rectangle1 = UIBezierPath(...)
) which is in the someObject.swift ?
I tried to add some functions like:
let tapGestureA:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(touchAction))
However, the scope confused me; like if I put the touchAction function out of the drawRectangle1
function, I will not be able to access rectangle1
.
How can I modify to make such a gesture recognizer work?