在Alamofire 4.0中初始化SessionManager

时间:2016-09-21 10:56:49

标签: ios swift alamofire

刚刚升级到Alamofire 4.0。遇到会话管理器问题。首先实际初始化它:

此前:

let alamoManager = Alamofire.SessionManager(configuration: configuration)

现在:

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

什么是会话委托对象以及为什么必须立即包含它?什么是信托政策?

1 个答案:

答案 0 :(得分:0)

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