项目作者: calvinwkl

项目描述 :
Using Combine for URLSession in Swift
高级语言: Swift
项目地址: git://github.com/calvinwkl/swift-combine-urlsession.git
创建时间: 2020-03-07T11:03:42Z
项目社区:https://github.com/calvinwkl/swift-combine-urlsession

开源协议:

下载


" class="reference-link">Using Combine for URLSession in Swift Swift

This repository illustrates an example to use Swift’s Combine to retreive JSON response and load to a UITableView.

However, Combine is best used with SwiftUI. This is only to replace the use of RxSwift in the previous example.

The Article

  • @calvinw/using-combine-for-urlsession-in-swift-1-replacing-rxswift-2cd022f57121">Using Combine for URLSession in Swift (1) - replacing RxSwift

Swift Package Manager

Mock API response

  1. [
  2. {
  3. "name": "Hong Kong",
  4. "desc": "The place I live.",
  5. "url": "https://en.wikipedia.org/wiki/Hong_Kong"
  6. },
  7. {
  8. "name": "Singapore",
  9. "desc": "A clean and disciplined place.",
  10. "url": "https://en.wikipedia.org/wiki/Singapore"
  11. },
  12. {
  13. "name": "Japan",
  14. "desc": "Love those yummy sushi and sashimi.",
  15. "url": "https://en.wikipedia.org/wiki/Japan"
  16. }
  17. ]