45

苹果开发中文网站Swift 5.0 值得关注的特性:增加 Result<T, E: Error> 枚举类...

 5 years ago
source link: http://www.cocoachina.com/ios/20190422/26856.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在异步获取数据的场景中,常见的回调的数据结构是这样的:表示获取成功的数据,表示获取失败的 error。因为数据可能获取成功,也可能失败。因此回调中的数据和错误都是 optional 类型。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK