U
U
Uno2017-11-04 22:54:54
iOS
Uno, 2017-11-04 22:54:54

Does the inscription fly behind the tap?

Good afternoon! Figachu in his program schedule. I want that when tapping on a specific chart point, the value would appear above the tap. The graph itself works, the values ​​are also displayed in a static UILabel, you just need to bind the UILabel coordinates to the tap coordinates somehow (to be a little higher, for correct display). How to do?
I would be happy with a specific example, if it's easy, or some material (preferably in Russian) on this matter.
Thanks everybody!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
briahas, 2017-12-01
@Noizefan

1) Read about the hitTest method in the UIView class:
implemented in the UIView descendant/extension via:
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
}
so you can get the coordinates of your
tap 2) Hang a tap gesture on the view, and inside its action you can get the coordinates from the gesture via:
open func location(in view: UIView?) -> CGPoint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question