UPDATE: I found a simple solution. I knew there was one!
I have a UIView
subclass called tipBalloon
that I've added as a subview of a UITextView
, but when I touch tipBalloon
, it doesn't focus the text view even though tipBalloon.userInteractionEnabled = YES
(by default).
How do I make it so that when I touch tipBalloon
, the touch is forwarded to the UITextView
? Shouldn't this happen automatically?
Here is an example:
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UITextView *payTextView = [[UITextView alloc] initWithFrame:CGRectMake(5.0f, 30.0f, 180.0f, 100.0f)];
[window addSubview:payTextView];
UIView *tipBalloon = [[UIView alloc] initWithFrame:CGRectMake(6.0f, 10.0f, 100.0f, 30.0f)];
tipBalloon.backgroundColor = [UIColor orangeColor];
[payTextView addSubview:tipBalloon];
[tipBalloon release];
window.backgroundColor = [UIColor brownColor];
[window makeKeyAndVisible];
return YES;
}