NSURLConnection Delegate 适用于 iOS 9 和 10?

NSURLConnectionDelegate works on iOS 9 and 10?

根据以下开发者网站 post:

https://developer.apple.com/reference/foundation/nsurlconnectiondelegate?language=objc

NSURLConnectionDelegate 的以下方法已从 iOS 8:

中弃用
connection:didReceiveAuthenticationChallenge:

connection:canAuthenticateAgainstProtectionSpace:

但我还在 iOS 9 和 iOS 10 中使用它们,OS 也调用它们。如果它们被弃用,有人知道它们是如何工作的吗?

弃用意味着他们计划将其删除。所以不是删除一个API,而是声明以后会删除但是仍然可用。 根据经验,您可以预期在弃用后 2 个主要版本将被删除 api。

维基百科是这样解释的:

In several fields, deprecation is the discouragement of use of some feature, design or practice; typically because it has been superseded or is no longer considered safe – but without completely removing it or prohibiting its use. https://en.wikipedia.org/wiki/Deprecation

我个人的偏好是始终立即修复此类警告,并尽可能跟上最新最好的 APIs。