Hello,
I have a situation here, I have to handle touchesBegan
for textfield. This textfield is in scrollview.
I tried this so far:
I made a subclass of UIScrollView
@interface CustomScrollView : UIScrollView
{
}
@end
@implementation CustomScrollView
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"good");
}
@end
Here, I can get the desired result.
Same thing I implemented with textfields. I made a subclass of UITextField
:
@interface CustomTextField : UITextField
{
}
@end
@implementation CustomTextField
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"good");
}
@end
This works fine if the text field is inside a normal view, but it fails when the text field is inside a regular scrollView or my custom scrollview.
Please enlighten me on this
(I am doing this to attain something like this when user long presses a textfield the text in textfield is assigned from Textfield to a label and user can drag this label to some other place in the view )