I have a function to retrieve data from an API using an URL link.
Everything works on iOS 8 but when I run it on a device with iOS 7, the following bit of swift code fails and the app crashes - the last line (when setting the session configuration) is the one that makes it crash.
I don't understand why, is it some feature not available in iOS 7 and how can I fix it?
var defaultConfigObject = NSURLSessionConfiguration.defaultSessionConfiguration()
defaultConfigObject.allowsCellularAccess = true
var session:NSURLSession = NSURLSession()
session = NSURLSession(configuration: defaultConfigObject)