Questions tagged [reswift]

25 questions
1
vote
2 answers

Swift - ReSwift Subscribe to multiple substates

i am using ReSwift in my project to get a nice and clean redux architecture. As i am not interested in the whole state i just subscribe to two substates for my viewcontroller: extension ViewController: StoreSubscriber { override func…
Creative crypter
  • 1,348
  • 6
  • 30
  • 67
1
vote
1 answer

ReSwift ActionCreator with callback / returning observable after dispatch

I'm using ReSwift and RxSwift (without that information the question wouldn't make much sense). Is there a standard way of dispatching an action creator in ReSwift and having something happened after it's finished processing (i.e., finished…
Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75
1
vote
1 answer

ReSwift middleware to load initial state

How do I load the initial app state from the database using ReSwift? I'm thinking something like a middleware for when the app state is first being initialized, i.e., the first time the reducers are called.
Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75
0
votes
0 answers

iOS app black screen when app coming from background

I am trying to find out what is the cause of a black screen that a comparatively small set of users are facing. Most of them are coming from the background. The app uses ReSwift for data refreshing, although that does not trigger the re run of the…
Inigo Llamosas
  • 457
  • 1
  • 4
  • 12
0
votes
1 answer

UITabBarController doesn't properly initialize tab view controllers

I'm creating a UITabbarController and all its tab's contents programmatically, like so: private func createTabBarController() { /* Only create tabBarController once! */ if (RootRouter._tabBarController == nil) { let…
BadmintonCat
  • 9,416
  • 14
  • 78
  • 129
0
votes
1 answer

How to dispatch an async action with parameters(payload) with ReSwift

How do we dispatch an async action with ReSwift with parameters? I have created this async action: func searchItems(state: AppState, store: Store) -> Action? { var items = [Artwork]() HttpHelper.post(url: serverApi.search.rawValue,…
Julian Gong
  • 360
  • 2
  • 8
0
votes
2 answers

Promise as a part of state in redux

I have a situation when it would be really convenient to have a promise object as a part of the state. In short - there is a state which contains all the info which user gave in the question-answer mode and after some answer it would be nice to send…
Vladyslav Zavalykhatko
  • 15,202
  • 8
  • 65
  • 100
0
votes
1 answer

Is having behavior on ReSwift states an anti-pattern?

I'm starting to play around with the concept of structuring app this way and I find myself tempting to have domain rules functions inside states so I can reuse them. Even I couldn't find any documentation about it, it does seem weird as states feel…
mdonati
  • 1,049
  • 11
  • 24
0
votes
1 answer

Swift typecasting/pattern-match condition this or that

My use case involves a switch statement and trying to build a case that depends on multiple typecasts. This will really help me introduce some composable/clean/less code. The generic multiple conditions won't work as I'm using let with the casting…
Michael Ramos
  • 5,523
  • 8
  • 36
  • 51
-2
votes
1 answer

How organize action-state flow of upload/download methods using ReSwift

I'm building application using Redux architecture with ReSwift framework, most of applications processes described by action - reducer - state flow. Now I have added two methods upload(image: UIImage, fileName: String) and download(fileName:…
zzheads
  • 1,368
  • 5
  • 28
  • 57
1
2