Monday, 15 September 2014

objective c - iOS view controller containment | Child View Controller passes touches to Parent View Controller -



objective c - iOS view controller containment | Child View Controller passes touches to Parent View Controller -

in ios5, utilize uiviewcontroller containment on app have implemented uitouchgesture in several places.

when add together kid viewcontroller (full screen) touches passed downwards parent.

what, if any, solution around this. utilize mpflipviewcontroller , can see page turning underneath kid when user moves finger across the kid viewcontroller.

for clarification, add together viewcontroller kid following:

[self addchildviewcontroller:vc]; [vc willmovetoparentviewcontroller:nil]; [self.container addsubview:vc.view]; [vc didmovetoparentviewcontroller:self];

the container simply uiview view of childviewcontroller & other uiview objects sit down on. thanks

you've got backwards. controller containment 1 thing, standard view hierarchy , responder chain stuff. touches sent parent; phone call made view's -(uiview *)hittest:withevent:. returns kid view if 1 can found. otherwise returns 1 of own views. perchance returns itself.

if touch beingness captured parent controller means it's never been sent child. not it's beingness sent kid ascending parent.

if want parent unusual touch capture utilize custom view , implement own -hittest:withevent:. first step, , log inputs see happens.

ios objective-c ios5

No comments:

Post a Comment