tags:

views:

29

answers:

1

Hi,

I have a controller managing a complex view which contains, among other objects, some labels and images. How can I subscribe to touch events to some of the labels and images from my controller? The problem is that UIView does not have a TouchDown event (unlike UIButton for example).

Two workarounds came to mind, which are both clumsy:

  • Put some invisible buttons about the labels and images I want to handle
  • Derive my own label and button components and override TouchesBegan

Is there any better way? In case it matters: I created the using interface builder.

Thanks,

Adrian

A: 

I solved this by styling my buttons to imitate the look of a label. It's not perfect, but the best workaround I have found.

Adrian Grigore