Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RefreshButtonModel: ObservableObject {
- @Published var showRotatingButton: Bool = false
- @Published var isRotating: Bool = false
- private var subscriptions: Set<AnyCancellable> = []
- init(loadingPublisher: AnyPublisher<Bool, Never>) {
- loadingPublisher
- .sink { isLoading in
- self.showRotatingButton = isLoading
- if !isLoading {
- self.isRotating = false
- }
- }
- .store(in: &subscriptions)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement