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
1
vote
0 answers

How to create textfield with limited amount of symbols to input

I'm trying to make a code verification screen. You probably saw it in every app, that requires phone or SMS verification. The main concern for me is how to set limited available characters for the user to type in the text field. I'm using reactive…
dand1
  • 371
  • 2
  • 8
  • 22
1
vote
0 answers

Are there deadlock risks in ReactiveCocoa?

Here is one example of many: You can bind one ReactiveCocoa property to another: property <~ otherProperty. What if you also do otherProperty <~ property? Will this create a deadlock? In general, what is the risk of deadlocks in ReactiveCocoa? Can…
code-ninja-54321
  • 509
  • 4
  • 12
1
vote
1 answer

ReactiveCocoa - concat flatten strategy not working as expected

I've started to learn reactive-cocoa from couple of days, today I was playing with the flatten method of the reactivecocoa (reactiveSwift), I tried executing the snippet given for the concat flattening in the documentation Basic operators. Here's…
iamyogish
  • 2,372
  • 2
  • 23
  • 40
0
votes
1 answer

Protocol constraint Equatable in Swift with ReactiveSwift map function

I am using ReactiveSwift. There are two protocols: CommonProtocol and SpecificProtocol. When I use SpecificProtocol in map function there is an error Type 'any SpecificProtocol' cannot conform to 'Equatable'. However it is perfectly fine with using…
Riddik
  • 2,565
  • 1
  • 11
  • 21
0
votes
0 answers

PromiseKit to ReactiveSwift migration: pending method in mock class

I want to know the equivalent part in ReactiveSwift for this PromiseKit code snippet import PromiseKit // import ReactiveSwift class MockA { .... public var addressReturnValue: Promise? public func createAddress() ->…
aguilarpgc
  • 1,181
  • 12
  • 24
0
votes
1 answer

What is correct way to make a UIButton change a MutableProperty?

The following code works: import UIKit import ReactiveSwift import ReactiveCocoa class ViewController: UIViewController { let myAction = Action { _ in return SignalProducer { observer, _ in …
Andrew Arrow
  • 4,248
  • 9
  • 53
  • 80
0
votes
1 answer

How to collect values every n seconds with a max count in each interval from a signal in ReactiveSwift?

It seems like a combination of collect(every:on:skipEmpty:discardWhenCompleted:) and collect(count:) in ReactiveSwift. The resulting signal would send an event every n seconds if the count of accumulated values doesn't reach max count during each…
ChaseChoi
  • 101
  • 5
0
votes
2 answers

Reduce array of properties ReactiveSwift

I have an array of Property, and I need to reduce them to get sum of the last inputs (it's basically an unread notification counter from different SDK's) and put that into new Property, I tried this let unseen: Property = .init( …
Andrii
  • 30
  • 3
0
votes
0 answers

Migrating from ObjC KVO to ReactiveSwift

I'm trying to migrate some parts of a project that was initially written in Obj-C. Currently I'm trying to migrate a code that relies heavily on signals. To give you a general idea of what I'm trying to migrate, here is a little piece of code which…
0
votes
1 answer

Reactive Swift Signal Producer conversion code to Combine.Publisher doesn't work with combine latest

Here's my code to convert ReactiveSwift Signal Producers to Combine.Publishers import ReactiveSwift import Combine /// convert SignalProducer -> Publisher public struct ReactiveSwiftPublisher: Publisher { public…
Yogurt
  • 2,913
  • 2
  • 32
  • 63
0
votes
1 answer

Swift: What will happen to DispatchQueue.async call when caller viewController is deinit()

I am working on a ViewController where I called my viewModel to do a DispatchQueue.async call. After the async task starts and before the end my task ViewController is deinited by pressing the back button. In that case, what will be happened to my…
0
votes
1 answer

ReactiveSwift pipeline flatMap body transform not executed

I have the following pipeline setup, and for some reason I can't understand, the second flatMap is skipped: func letsDoThis() -> SignalProducer<(), MyError> { let logError: (MyError) -> Void = { error in print("Error: \(error); \((error…
Zsolt
  • 3,648
  • 3
  • 32
  • 47
0
votes
1 answer

ReactiveSwift error after update to Xcode12( Error msg: Cannot convert value of type 'Disposable?' to closure result type 'Void')

The following func runs well before I update to Xcode12, I'm new to ReactiveSwift and I don't know how to fix this issue, thanks for you help! Error message: Cannot convert value of type 'Disposable?' to closure result type 'Void' public func…
ImWH
  • 820
  • 1
  • 7
  • 20
0
votes
1 answer

ReactiveSwift pipeline count failures after all complete

I have a pipeline in ReactiveSwift for uploads. I want to make sure that even if one of the uploads fail, the rest will not be interrupted. After all of them complete with success or failure, I should either return success from the performUploads…
Zsolt
  • 3,648
  • 3
  • 32
  • 47
0
votes
1 answer

Ambiguous use of operator '<~' in ReactiveSwift

I inherited a somewhat old project written in ReactiveSwift (v3.1.0) and ReactiveCocoa (v7.2.0). When I opened it on Xcode 10.1, it was built without an issue. But when I did the same on Xcode 10.3, I get the error Ambiguous use of operator '<~' on…
Isuru
  • 30,617
  • 60
  • 187
  • 303
1 2 3
8 9