gpt4 book ai didi

swift3 - 如何在Swift 3中设置共享URLCache?

转载 作者:行者123 更新时间:2023-12-03 14:33:05 25 4
gpt4 key购买 nike

这是我们在Swift 2中编写的代码。什么是Swift 3版本?我看不到setShared的替代品。

let sharedCache: NSURLCache = NSURLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
NSURLCache.setSharedURLCache(sharedCache)

最佳答案

这适用于Xcode 8 Beta 4

    URLCache.shared = sharedCache

关于swift3 - 如何在Swift 3中设置共享URLCache?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38249573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com