objective-c iPhone top level UIView blocking touch input in iOS 9 -


i need have view on top (used dither application). part works great, every view controller present displayed under view's layer.

toplevelwindow = [[uiapplication sharedapplication] keywindow]; if(nil == toplevelwindow) toplevelwindow = [[[uiapplication sharedapplication] windows] lastobject];  topview = [[uiview alloc] initwithframe:cgrectmake(0, 0, toplevelwindow.bounds.size.width, toplevelwindow.bounds.size.height)]; topview.backgroundcolor = [uicolor blackcolor]; topview.alpha = 0.5f; topview.layer.zposition = maxfloat; topview.userinteractionenabled = false; [toplevelwindow addsubview:topview]; 

however, when present mail view controller:

mfmailcomposeviewcontroller* controller = [[mfmailcomposeviewcontroller alloc] init]; [self presentmodalviewcontroller:controller animated:yes]; 

the email input form displayed expected, under topview layer. however, unlike other view controllers present (and present several layers), mail input view not respond touch. thus, user can't send email or dismiss email view controller. user has no option other kill app. it's topview intercepting touch input.

any ideas of going on? btw, worked fine in ios 7, not work in ios 9.

any thoughts or suggestions appreciated!

try subclassing uiview use topview , override method:

- (bool)pointinside:(cgpoint)point withevent:(uievent *)event {     return no; } 

that make pass through user interaction.

edit:

on second thought, not sure suggestion since manipulating layer's zposition. puts view on top visually, not change index of view among superview's subviews. can make things little tricky since taps registered view highest index, regardless of zposition of layers.


Comments