I want to build an iPhone app that displays a floor plan of different regions/rooms. When a user taps on a region/room, it shows the hit-state color for a fraction of a second before sliding to a new UIView with additional text information.
Should I be setting up all the different regions via UIImages or should I draw my own floor plans programmatically? I tried drawing some rectangles programmatically, but wasn't sure if it's possible to attach tap event handlers to the graphics. Or if it's easier to maintain floor maps with unusual shapes programmatically.
My requirement was same like you. See my Question. Finally i am go ahead with UIScrollView with Zoom in out functionality. I have add multiple UIViews in Scroll and all UIViews have UILable So it will look like Room / Booth and it will look like this Question. To archive this i have face one Query and finally resolved this and implement the Floor Map Like my 1st question link.
Now to resolved your question that You have to implement UITapGestureRecognizer like below code.
UITapGestureRecognizer *fingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handlefingerTap:)];
fingerTap.delegate = self;
[fingerTap setNumberOfTapsRequired:1];
than you have to set this Gesture to your view and implement the tap method like below
[rigionView addGestureRecognizer:fingerTap];
- (void)handlefingerTap:(UIGestureRecognizer *)gestureRecognizer
{}
If you have add multiple UIViews in Scroll than implement the above code in for loop.i have done the same.
I hope it will help you..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With