Closed dltlr closed 9 years ago
@dltlr I have verified and present the viewcontroller
modally and it is working fine.Can you please give more details about the scenario.It will really helpful to debug the issue.
Thanks, I had the same problem but resolved by it. It happens when transition view in showAlert's userAction.
println(UIApplication.sharedApplication().keyWindow?.subviews)
Normal:
Optional([<UITransitionView: 0x7fdddcb7d490; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7fddda426490>>])
Bad case:
Optional([<UITransitionView: 0x7f9c3b05b710; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f9c3b00d990>>, <UITransitionView: 0x7f9c3b251f10; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f9c3b2284c0>>])
@nagaho @dltlr I have resolved the issue. Please reopen if you get again :)
I had to change this line: let window = UIApplication.sharedApplication().keyWindow?.subviews.first as UIView to this (notice the .last) to get it to work for me from a modally presented view controller within an app. let window = UIApplication.sharedApplication().keyWindow?.subviews.last as UIView It seems to work, but I'm not really sure what the correct change should be.