![](/img/trans.png)
[英]Observable sequence called several times on retryWhen, but should call only once
我正在嘗試使用以下教程構建 RxSwift Auth 令牌刷新服務: https://www.donnywals.com/building-a-concurrency-proof-token-refresh-flow-in-combine/ 。 但是,我遇到了問題,當用戶沒有身份驗證令牌並且第一次刷 ...
[英]Observable sequence called several times on retryWhen, but should call only once
我正在嘗試使用以下教程構建 RxSwift Auth 令牌刷新服務: https://www.donnywals.com/building-a-concurrency-proof-token-refresh-flow-in-combine/ 。 但是,我遇到了問題,當用戶沒有身份驗證令牌並且第一次刷 ...
[英]SwiftUI Combine synchronously execute codes
我打電話給 API 並根據響應執行一些操作。 現在如何依次執行task1、task2、task3。 我知道我可以將所有代碼放在一個接收器塊中。 為了代碼可讀性,我使用了share()運算符。 ...
[英]How to make restartable countdown using Rxswift
我想創建一個倒計時功能,每次按下按鈕時都會重新啟動。 但是,我編寫的代碼會在倒計時結束時終止訂閱。 我該怎么做才能確保我的訂閱不會被終止並重新開始倒計時? ...
[英]Swift UIAlert doesn't waiting user response
我在 ViewController 中添加了 UIAlert 但它不等待用戶響應並顯示錯誤。 我也試過在 self.present 上等待,但也沒有工作。 permissionInit 有一個 await 但它似乎不起作用。 我想在 oder 中顯示 UIAlert。 如果您能告訴我哪一部分是錯 ...
[英]Unit testing void function in Swift
我是單元測試的新手。 我在我的項目中使用 MVVM。 我還使用 RxSwift 在視圖和 ViewModel 之間傳遞數據或進行通信。 我不明白如何在我的案例中編寫單元測試。 任何建議都是可觀的。 我真的很感激你能提供的任何幫助。 注意: httpMovieService.searchMovies ...
[英]Hide UIButton after click in RxSwift
我需要在使用 RxSwift 單擊后隱藏 UIButton。 我沒有辦法做到這一點。 在這里需要幫助! ...
[英]Creating an Observable around an async/await method using RxSwift
我正在使用 AWS Amplify 庫https://github.com/aws-amplify/amplify-swift與 Cognito 服務通信。 大多數函數都使用新的異步/等待方法進行了重寫。 查看以下方法:func fetchAuthSession() async throws -& ...
[英]RXSwift - Waiting multiple API or task to finish
我是 RxSwift 的新手,我想實現這樣的目標。 這是情況我有 2 個不同的 API 需要填充到 UITableView 中。因此我需要合並 2 組數據我想實現類似等待 2 個 API 完成返回數據的操作,然后我重新加載 UITableView 一次。 我試過 Observable.zip 和 O ...
[英]iOS RxSwift make event view based on observable array data
你好我准備ios開發者對不起,因為不會說英語不好我想知道一般如何實施它。 訂閱數組數據並制作自定義視圖doTableViewModel.doItems .observe(on: MainScheduler.instance) .subscribe(onNext: { viewMode ...
[英]Combine array of object from different endpoint so it can also pagination
我有 2 個不同的端點: 第一個有分頁。 第二個沒有分頁我從第一個和第二個端點映射 object,因此當我顯示它時它們具有相同的 object 並且僅限制 10 個項目。 問題是.. 是否可以組合調用的 API 以便我可以使用不同端點的分頁? 所以結果是將 object 合並為 1 按日期排序限制項 ...
[英]Why does this NOT leak memory? RxFeedback
class ViewModel { ... func state(with bindings: @escaping (Driver<State>) -> Signal<Event>) -> Driver<State> { Driver. ...
[英]RxSwfit - dequeueReusableCell crash
所以我試圖以編程方式將 tableView 添加到 viewController。 當到達驅動程序時,我在注冊單元格后在 dequeueReusableCell 上崩潰。 視圖控制器: 視圖模型: 在此行上出現此崩潰錯誤 - let cell = tableView.dequeueReusable ...
[英]Selector type of expression is ambiguous without more context
我正在嘗試使用選擇器獲取 ARSessionDelegate 方法,但我收到此錯誤: Type of expression is ambiguous without more context 有我的代碼: 這就是這個方法的樣子: 而且,我正在嘗試使用此答案為 ARKit session 進行 rx ...
[英]RxSwift, RxCocoa - no called when writing TextField after validation
我是 RxSwift 和 RxCocoa 的新手,我需要任何學習建議檢查 ID 驗證結果后,label 中沒有字但它正在更新 label 並且在綁定 function 處沒有進入斷點我的代碼有什么問題……? var disposeBag: DisposeBag = DisposeBag() ...
[英]RxSwift increase perfomance
這個 RxSwift 代碼運行速度很慢,所以請給我一個關於如何提高它的性能的建議? 這個 function 正在獲取圖像資源並將它們映射到重繪圖像 我使用翠鳥下載圖像 我使用蘋果視覺識別文本區域 和 Moya 用於網絡 使用 UIGraphics 渲染器重繪圖像 我覺得還有另一種方法可以不讓這么大量 ...
[英]Observing ViewWillAppear (Migrating RXSwift to combine)
我想像self.viewWillApplerPublisher一樣觀察 viewWillAppear 請幫助如何觀察它 ...
[英]Handle unrelated serial api calls in RxSwift
我需要從 RxSwift 中具有不同模型的多個請求中獲取響應。 我想在沒有 GCD 或 Semaphore 且僅使用RxSwift的情況下執行此操作。 我嘗試了這段代碼,但在不同模型和結果對象數量的不同響應中存在一些問題。 ...
[英]How to handle refreshing credentials using RxSwift
我的應用程序中的身份驗證流程有問題。 有一些 API 用於授權(它是如何工作的:我正在發送請求,它在 HTTPCookieStorage.shared 中設置身份驗證令牌cookies並帶有一些過期時間(20 分鍾))。 如果用戶通過身份驗證,我在HTTPCookieStorage.shared中有 ...
[英]"withLatestFrom" won't accept BehaviorRelay
我有這個簡單的視圖 model 在注冊用戶之前檢查電話號碼的狀態。 但我有這個錯誤: 實例方法“withLatestFrom”要求“BehaviorRelay”符合“SharedSequenceConvertibleType” 這是代碼: 這里出了什么問題? 為什么withLatestFrom不能 ...
[英]Why RxCocoa didn't provide subscribe for UILabel's text change?
RxCocoa 提供訂閱UITextField和UITextView文本更改:UITextField().rx.text.orEmpty.changed .subscribe { text in print(text) } .disposed(by: di ...