I would like to built an iPhone/iPad application to show large images (in a scrollView or something else which support dragging and zooming) that allow user to:
So I want to ask that:
It is nearly similar to tagging functionality of Facebook App in iPhone.
Any help is appreciated, thank in advance!
1 . You subclass the UIImageView and override the touch methods:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
2 . You add and UIButton to the UIImageView [yourImageView addSubview:yourButton];
then set the center of your button to touch coordinates.
3 . Just present an popover when user taps on an button. (You can set tag property for buttons to know which button is tapped)
4 . Save data to an plist to documents directory if is not to complex ore use core data.
Good Luck. Just post comments if you need more help.
Edit: you need to set the user userInteractionEnabled to YES for the UIImageView.
userInteractionEnabled A Boolean value that determines whether user events are ignored and removed from the event queue.
@property(nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled Discussion This property is inherited from the UIView parent class. This class changes the default value of this property to NO.
Availability Available in iOS 2.0 and later. Declared In UIImageView.h