Type 'AnyObject' does not conform to protocol 'BooleanType'
<p>this is my code in objective c </p>

<pre><code> id locationValue = [launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey];
if (locationValue)
{
    UIApplication *app  = [UIApplication sharedApplication];
    UIBackgroundTaskIdentifier bgTask = UIBackgroundTaskInvalid;
    bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
        [app endBackgroundTask:bgTask];
    }];
    [self startLocationUpdates];
}
</code></pre>

<p>i define locationValue as AnyObjectType and the error mentioned as the title hits at the line </p>

<pre><code>if(locationValue)
</code></pre>

<p>I am converting this to swift .. so please help..</p>