Kex Kex - 1 year ago 352
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:


let alamoManager = Alamofire.SessionManager(configuration: configuration)


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 Source
let configuration = URLSessionConfiguration.default
var alamofireManager = Alamofire.SessionManager(configuration: configuration)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download