Questions tagged [rx-cocoa]

238 questions
2
votes
1 answer

RxSwift "tableView.rx.modelSelected" called multiple time

I am new on RxSwift and I am trying to implement UITableView with it. I successfully implemented UITableView cell with rx.items and now I need to use didSelect method. My problem is; my first cell selection, it called only once and I printed item.…
Göktuğ Aral
  • 1,409
  • 1
  • 13
  • 28
2
votes
1 answer

Make RxCocoa binding for UIPageViewController.setViewControllers (how to synchronize Observable)

currently, I want to bind the value of Observable to my UIPageViewController. Initial idea is simple and straightforward: viewControllerObservable .subscribe(onNext: { [weak self] viewController in …
cleg
  • 4,862
  • 5
  • 35
  • 52
2
votes
1 answer

RxSwift 4/RxCocoa 4 Deprecating Variable - pros and cons

In the future, Variable will be deprecated in RxSwift 4. Instead, Relay classes were first implemented in RxCocoa 4, and an alternate proposed to Variable is BehaviorRelay. Assigning the value of a Variable is an imperative programming-style…
2
votes
2 answers

Make Observable for UIButton isHighlighted property

I'm trying to create isHighlighted Observable for my UIButton, to send sequence every time isHiglighted for UIButton has changed. And I've write something like this extension Reactive where Base: UIButton { var isHighlighted: Observable
Michal Rogowski
  • 431
  • 3
  • 18
2
votes
0 answers

awakefromnib not called for UICollectionReusableView when using RxSwift datasource

I'm using RxSwift, I managed to create the dataSource and I retrieve cells correctly. Problem is with the section headerView. I have created a UICollectionReusableView class, attaching outlets from storyboard. The problem is that I retrieve the…
2
votes
1 answer

My custom RxDelegateProxy immediately disposing

I have some third party library that has delegate methods. But I like using RX so I should create RxDelegateProxy to receive delegate's callbacks via RX. Here my custom DelegateProxy class: extension Reactive where Base:GalleryController { var…
user3742622
  • 1,037
  • 3
  • 22
  • 40
2
votes
1 answer

Rx table view not being reloaded after the datasource gets updated

I have a table view that I am trying to make reactive. I have it working using Swift. Following is the RxSwift code viewModel.getDetailMessages().asObservable().bind(to: messageTableView.rx.items){ tableView, row, element in let…
A.S
  • 798
  • 1
  • 10
  • 32
2
votes
2 answers

How to prevent duplicate UIButton taps in UITableViewCell with RxSwift disposeBag

First of all sorry for the confusing title, but I actually can't come up with something better (if you do, please edit). I have an application using Coordinator pattern and RxSwift, so all in all I wan to pass all navigation related stuff to…
cojoj
  • 6,405
  • 4
  • 30
  • 52
2
votes
0 answers

Wrapping custom class delegates into RxSwift Observables

I am trying to observe on custom class delegates. I started with public var didTapAvatar: Observable<()> { return delegate …
Ray Tso
  • 566
  • 9
  • 17
2
votes
1 answer

how to observe PublishSubject on button tap

I'm dealing with such case and I think of applying RxSwift here. I have .xib UIView with button. class RightButtonItemView: UIView { @IBOutlet weak var rightButtonimageView: UIImageView! @IBOutlet weak var rightButtonButton: UIButton! …
dand1
  • 371
  • 2
  • 8
  • 22
2
votes
1 answer

RxSwift: Repeat a (completed) stream

Assume I have a button which can be used to start and stop (toggle) an action. let toggleStream: Observable = toggleBtn.rx.tap.scan(false) { state, _ in !state } I have another stream, that emits Integers continuously. let emitter =…
hendra
  • 2,531
  • 5
  • 22
  • 34
2
votes
1 answer

No 'items' candidates produce the expected contextual result type '(Observable<[Product]>) -> (_) -> _'

Here is my code snippet: class ProductCategoryCell: UITableViewCell { @IBOutlet weak var collectionViewProducts: UICollectionView! // other stuff... func setProducts() { let productsObservable = Observable.just([ Product(name:…
Gasim
  • 7,615
  • 14
  • 64
  • 131
2
votes
1 answer

onNext not getting called unit testing RxCocoa Driver

I'm attempting to write a unit test for Driver from RxCocoa library. Here's my simplified implementation code: struct LoginViewModel { var username: Driver! var password: Driver! var loginTaps: Driver! func…
Alex
  • 739
  • 1
  • 6
  • 18
2
votes
2 answers

How to design different collection cell

i've a collectionView with different collectionCell and i want to set a scale/height/size depending of the cell. How can i do it ? Here is the image of my different cell : a title cell, and 2 different cell image. One is width of the view / 3 and…
Makaille
  • 1,636
  • 2
  • 24
  • 41
1
vote
1 answer

How to handle user interactions in subviews with iOS MVVM

For implementing MVVM with a table view controller, it is often to have a single parent view model and a bunch of child view models for each cell. Let's say each cell has a like button, and now the user taps one of the like buttons. After searching…
Andy
  • 33
  • 1
  • 4