I want to make custom system to control some parameters of each room from iPad. I'd like to make each segments, which is shown on screenshoot, clickable, and the problem is that i don't understand how to make them clickable as buttons. Can somebody help with this task? I'm using Swift 4 and iPad Pro 9,7.
Asked
Active
Viewed 136 times
1
-
How are you building the segments? Show the code that you have tried. – MwcsMac Apr 29 '18 at 19:50
-
Screenshot is a sketch. There is no code yet, but i do not want to use paths, i want to use them as buttons and add them in storyboard. – Alexander Molodozhan Apr 29 '18 at 19:56
1 Answers
1
The native UIButton does not allow this. Your best bet would be to describe the plan as a set of CGPaths and hit test them.
You can have an UIView representing the floor plan, each room is a CGPath owned by the view and a custom UITapGestureRecognizer on the view that tests each of the CGPaths.

Морт
- 1,163
- 9
- 18