I have a camera app that is running fine on iOS 7. In the viewDidAppear
call of my MainViewController
I am first checking if the application state in not inactive and the application is not in background.
The code sample is given below.
-(void) viewDidAppear
{
if ((UIApplicationStateBackground != [UIApplication sharedApplication].applicationState)
&& (UIApplicationStateInactive != [UIApplication sharedApplication].applicationState))
{
// check if the camera is running
// perform the animation of opening shutter.
}
}
My problem is that on iOS 8 beta 2 [UIApplication sharedApplication].applicationState
returns UIApplicationStateInactive
hence the check fails. But on iOS 7 [UIApplication sharedApplication].applicationState
returns UIApplicationStateActive
and works without any problem.
Has anyone else faced the same issue?
EDIT
A simple experiment of putting breakpoints in viewDidAppear
and appDidBecomeActive
in xcode 6 reveals that viewdidAppear
gets called first. I suppose its a bug in iOS 8