Questions tagged [reactive-swift]

Anything related to the ReactiveSwift library that brings the reactive programming primitives in Swift

ReactiveSwift is a library that brings the reactive programming approach on Swift. It offers composable, declarative, and flexible primitives that are built around the grand concept of streams of values over time.

This is a pure-Swift implementation of the reactive API. It provides all the nuts and bolts, including Signals, SignalProducers, Properties, Actions and Bindings.

ReactiveSwift documentation

ReactiveSwift project on GitHub

124 questions
0
votes
1 answer

'() -> BindingTarget' is not convertible to '(Bool) -> BindingTarget'

I recently inherited a iOS project written using ReactiveSwift 3.1.0 and ReactiveCocoa 7.2.0. I'm tasked with updating it to Swift 5 and the latest ReactiveSwift versions. I updated ReactiveSwift to 6.1.0 and ReactiveCocoa to 10.1.0. I'm not well…
Isuru
  • 30,617
  • 60
  • 187
  • 303
0
votes
1 answer

How to observe objects count on realm db

I want to observe the object count of the realm DB. I wrote this approach: let realm = try? Realm() self.notificationToken = realm?.objects(AnalyticsEventDto.self).observe { _ in if let count = realm?.objects(AnalyticsEventDto.self).count { …
Maor
  • 3,340
  • 3
  • 29
  • 38
0
votes
1 answer

Dont complete on fail in Reactive Swift

I have a function capturing events from an api which works great. The only issue is i dont want the stream to be complete when it fails. public func getDeviceEvent(deviceUID: String) -> SignalProducer { …
Wazza
  • 1,725
  • 2
  • 17
  • 49
0
votes
1 answer

ReactiveSwift chained SignalProducers will not send completed to downstream

since Im new to the reactive programming, I have somewhat beginner question about chaining SignalProducers in ReactiveSwift. My goal is to create a chain of SignalProducers, to test one of my flows. Doing the SignalProducer chaining I stumbled upon…
Ollikas
  • 199
  • 1
  • 3
  • 14
0
votes
1 answer

How create date schedular?

I am trying to create a date scheduler to observe some event. But it does not work. I've looked through protocol DateScheduler and it is said that action will take place at currentDate in some methods protocol DateScheduler. I am trying doing…
Taras
  • 1,485
  • 1
  • 16
  • 31
0
votes
0 answers

Debugging with ReactiveSwift causes $__lldb_injected_self

So, I have been using ReactiveSwift for a long time. Most of the time, when I am using po I am able to see the value of a instance/local/global variable. But there are times when the call stack is so deep, that calling po would fail. Attached…
0
votes
1 answer

Why observeValues block not called?

Try to use ReativeSwift on my project, but something not perform well I have check many times, cant find out what's wrong. Everything is right, and it just not called. class MSCreateScheduleViewModel: NSObject { var scheduleModel =…
lin fan
  • 3
  • 1
0
votes
1 answer

How to dispose DisposeBag when using ViewModelOwners with ReactiveCocoa

ViewModelOwners documents how to use with ReactiveCocoa CompositeDisposable The Example is even implemented with ReactiveCocoa. However, I do not understand how the disposeBag is actually disposed since CompositeDisposable does not dispose…
MeXx
  • 3,357
  • 24
  • 39
0
votes
1 answer

Bind a collection type to ViewModel property

I have an array of items (each corresponds to a cell data) and I want to create an array of cell ViewModels. When I try to map the item to MutablePropery, I get Binary operator '<~' cannot be applied to operands of type…
sarawanak
  • 387
  • 1
  • 6
  • 17
0
votes
4 answers

Swift tuple declaration in a protocol

I have a tuple variable in my code, that comes from ReactiveSwift: class MyClass { var (signal, signalSender) = Signal.pipe() } How can I declare that variable tuple in a protocol? Similar like this (doesn't work): protocol…
SchmidtFx
  • 498
  • 4
  • 16
0
votes
1 answer

How to deal with reactive programming updates and CollectionView

I have a web socket that can add or remove data to a MutableProperty<[Stuff]> But when I reload the collectionView with collectionView.reloadData(). Web sockets add or remove data to the MutableProperty<[Stuff]>, so it will crash for multiple…
0
votes
1 answer

Reactive cocoa forcing a synchronous function to wait for reactive callback

I did a lot of research and haven't got any answer for this one. this is my code: fileprivate var dispose: ScopedDisposable? func connectToServer() { ... let user = ... let channelName = getChannelName(user) …
B.B.
  • 19
  • 4
0
votes
1 answer

API Request in ReactiveSwift

I am beginner in ReactiveSwift. I create weather app and my request does not work. func fetchCurrentWeather() -> SignalProducer { guard let unwrappedURL = url else { return SignalProducer.empty } return…
0
votes
1 answer

Skip(while:) call against a Signal in ReactiveSwift is being ignored

I have an observer against a Signal that is producing an item count in my app. Ideally, I would like to skip all values of 0, which I have attempted to do using the following code snippet: viewModel.itemCount.signal .skipRepeats() …
CodeBender
  • 35,668
  • 12
  • 125
  • 132
0
votes
1 answer

ReactiveSwift SignalProducer : Argument 'failed' must precede argument 'value'

I am trying to update an upgrade an old piece of code using ReactSwift because I want ti run it with XCode 9. I have defined a class Network final class Network: NSObject { static func request(_ URLRequest: URLRequestConvertible) ->…
user3239711
  • 639
  • 1
  • 7
  • 24
1 2 3
8 9