Avatar
import APIKit class HogeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let request = HogeRequest() Session.send(request) { result in switch result { case .success(_): print("success") case .failure(_): print("failure") } } } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) Session.cancelRequests(with: HogeRequest.self) } } 通信中に画面を離れるタイミングでキャンセルしたいのですが、うまく動作せず通信成功してしまいます。 原因が全くわかりません。 どこかおかしいところありましたらご教示頂けると助かります🙇‍♂️ https://github.com/ishkawa/APIKit/blob/master/Documentation/GettingStarted.md#canceling-request (edited)
Type-safe networking abstraction layer that associates request type with response type. - APIKit/GettingStarted.md at master · ishkawa/APIKit