I couldn’t get it to work with the gesture recognizer in my application.
In viewDidLoadI added these
let orangeIndicatorTap = UITapGestureRecognizer(target: self, action: #selector(self.orangeIndicatorClick(_:)))
orangeIndicatorTap.numberOfTapsRequired = 1
orangeIndicatorTap.delegate = self
conceptMiddleOrangeIndicator.tag = 1
conceptMiddleOrangeIndicator.isUserInteractionEnabled = true
conceptMiddleOrangeIndicator.addGestureRecognizer(orangeIndicatorTap)
let greenIndicatorTap = UITapGestureRecognizer(target: self, action: #selector(self.greenIndicatorClick(_:)))
greenIndicatorTap.numberOfTapsRequired = 1
conceptMiddleGreenIndicator.isUserInteractionEnabled = true
conceptMiddleGreenIndicator.addGestureRecognizer(greenIndicatorTap)
let purpleIndicatorTap = UITapGestureRecognizer(target: self, action: #selector(self.purpleIndicatorClick(_:)))
greenIndicatorTap.numberOfTapsRequired = 1
conceptMiddlePurpleColorIndicator.isUserInteractionEnabled = true
conceptMiddlePurpleColorIndicator.addGestureRecognizer(purpleIndicatorTap)

Is there any other way to add a click event to my overlapping custom uitextviews?
source
share