Kex Kex - 2 months ago 128
Swift Question

Initializing a SessionManager in Alamofire 4.0

Just upgraded to Alamofire 4.0. Having issues with the session manager. Firstly actually initialising it:

Previously:

let alamoManager = Alamofire.SessionManager(configuration: configuration)


Now:

let alamoManager = Alamofire.SessionManager(configuration: configuration, delegate: SessionDelegate, serverTrustPolicyManager: ServerTrustPolicyManager?)


What is the session delegate object for and why does it have to be included now? What is the trust policy?

Answer
let configuration = URLSessionConfiguration.default
var alamofireManager = Alamofire.SessionManager(configuration: configuration)
Comments