简体   繁体   English

在Alamofire 4.0中初始化SessionManager

[英]Initializing a SessionManager in Alamofire 4.0

Just upgraded to Alamofire 4.0. 刚升级到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? 什么是信托政策?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM