tags:

views:

16

answers:

2

Hi all,

First Scenario : Suppose we have a first view as FirstView. in this view(FirstView) we add another view(SecondView) having exactly same frame as FirstView as

[FirstView addSubView:SecondView];

Now touch event of which view(FirstView or SecondView) will get called?

Second Scenario :

suppose after adding SecondView(frame exactly same as FirstView) to FirstView I write [FirstView:sendSubView];

Now touch event of which view will get invoked?

+1  A: 

First Scenario:

If the second view can receive user actions(that is user interaction enabled) then second view's touch events gets called.

Second Scenario:

I believe the function you were mentioning is sendSubViewToBack. In this case, if no other subviews were added to the firstview, it is equivalent to first scenario.

SegFault