An extremely simple example app, being built with ReSwift.
To install & run this app you will need to:
- Clone this git repository
- Install Carthage
- Run
carthage update --no-build && carthage checkout
in the root directory of the checked out project
Demo Application of Unidirectional Data Flow in Swift, Built with ReSwift
Home Page: https://github.com/ReSwift/ReSwift
License: MIT License
My steps:
git clone https://github.com/ReSwift/CounterExample-Navigation-TimeTravel.git
cd CounterExample-Navigation-TimeTravel
carthage update
Got the following error message:
*** Building scheme "ReSwiftRecorder" in ReSwiftRecorder.xcodeproj
** BUILD FAILED **The following build commands failed:
CompileSwift normal arm64 /Users/zhouhao/Projects/Swift/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift
CompileSwift normal arm64 /Users/zhouhao/Projects/Swift/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistorySliderView.swift
CompileSwift normal arm64 /Users/zhouhao/Projects/Swift/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryCollectionViewCell.swift
CompileSwift normal arm64 /Users/zhouhao/Projects/Swift/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryView.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)
Hi, I tried following in the guide in the README, but I'm getting lots of errors.
Here's what I did:
cloned the repo
ran the carthage command: carthage update --no-build && carthage checkout
console output:
*** Fetching ReSwift-Router
*** Fetching ReSwift
*** Checking out ReSwift-Router at "5231c3e645317c32977b8514aeee6f6f8e3aa16e"
*** Checking out ReSwift at "e623331b63cd0b65e04cdb7a031fc42a41e5f558"
*** Checking out ReSwift-Router at "5231c3e645317c32977b8514aeee6f6f8e3aa16e"
*** Checking out ReSwift at "e623331b63cd0b65e04cdb7a031fc42a41e5f558"
When I open the project in xcode and hit the play button though I get 15 errors:
build time output:
ReSwiftRouter project Group
Validate Project Settings Group
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Router/ReSwiftRouter.xcodeproj Update to recommended settings
SwiftLintIntegration Group
Target Integrity Group
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift/ReSwift.xcodeproj The file “Pods-SwiftLintIntegration.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift/Pods/Target Support Files/Pods-SwiftLintIntegration/Pods-SwiftLintIntegration.debug.xcconfig)
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift/ReSwift.xcodeproj The file “Pods-SwiftLintIntegration.release.xcconfig” couldn’t be opened because there is no such file. (/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift/Pods/Target Support Files/Pods-SwiftLintIntegration/Pods-SwiftLintIntegration.release.xcconfig)
ReSwiftRouter-iOS Group
Warning Group
Directory not found for option '-F/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/Carthage/Checkouts/ReSwift-Router/Carthage/Build/iOS'
ReSwiftCounterExample Group
Warning Group
Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the ReSwiftCounterExample editor.
Swift Compiler Error Group
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/ViewControllers/StatsViewController.swift:19:55: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/ViewControllers/StatsViewController.swift:21:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/ViewControllers/StatsViewController.swift:32:40: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/ViewControllers/StatsViewController.swift:34:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:58:35: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:60:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:67:35: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:69:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:97:51: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:98:13: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:100:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:115:35: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:117:38: Use of undeclared type 'RoutingCompletionHandler'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:131:61: Use of undeclared type 'RouteElementIdentifier'
/Users/jim/Git-Projects/CounterExample-Navigation-TimeTravel/ReSwiftCounterExample/AppDelegate.swift:133:38: Use of undeclared type 'RoutingCompletionHandler'
Are there any other commands I need to run?
Thanks! ❤️
Hi,
CounterExample-Navigation-TimeTravel is failing to build at the moment with xcode 8.1, would be great to fix it...
Since ReSwift 4.X released long time ago, perhaps this example should update as well. Because this is the main and primary example source of 3 included frameworks.
One of the most confusing changes for me is stateTransform: <#T##(Subscription<_>) -> Subscription<NavigationState>#>)
in Router initializer from "ReSwift-Router" and I didn't find a clear documentation or example about it.
So it would be grate if you guys plan to update this repo ( starting from the issue above ;) )
thanks
Hey,
I don't know where else to post this question. I hope this github issue is okay.
I am new to redux and have been reading a lot about it lately.
According to this video https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree going redux means that you are storing the whole app state as a single immutable object. Obviously somewhere a line has to be drawn.
Where do you draw the line and how do you decide it is the right place? For instance I see you are switching tabs redux style. Returning false and letting the reducers change state.
extension AppDelegate: UITabBarControllerDelegate {
func tabBarController(tabBarController: UITabBarController,
shouldSelectViewController viewController: UIViewController) -> Bool {
if viewController is CounterViewController {
mainStore.dispatch(
SetRouteAction(["TabBarViewController", CounterViewController.identifier])
)
} else if viewController is StatsViewController {
mainStore.dispatch(
SetRouteAction(["TabBarViewController", StatsViewController.identifier])
)
}
return false
}
}
There's a lot of state going on in a normal application. Like scroll offset in a scrollview, user typing individual characters as input in a text field or subtle animations when tapping a button. I mean the blinking caret in the text field can't and shouldn't be handled by redux. :D What are your thoughts on this?
dyld: Library not loaded: @rpath/ReSwift.framework/ReSwift
Referenced from: /var/mobile/Containers/Bundle/Application/9E290F65-591B-48E0-B2B6-95B401ED3A8D/ReSwiftCounterExample.app/ReSwiftCounterExample
Reason: image not found
Hi, I'm an author for Ray Wenderlich's website and am looking to write an article on ReSwift. I've had quite a lot of Redux experience (I'm more of a JS developer than an iOS developer at the moment).
I definitely like the look of ReSwift - nice job!
Although, this example is described as:
A very simple counter app implemented with ReSwift.
And unfortunately, it is not! The addition of time travel makes your actions look really quite complicated. Which was a real turn-off when I initially looked at the code.
I think your simplest example should be just that .... really really simple.
I'd propose having nothing more than the code in the ReSwift README, just like this:
https://github.com/ColinEberhardt/CounterExample
I'd be happy to add a README, and some lightweight docs, to this above project and move it under the ReSwift org if you like?
My Xcode's Version 7.3.1 (7D1014)
Simulator iPhone 6s Plus
It is give a warning of Embedded by dylibs/framework only run on iOS or later
in Nimble-iOS
But my main issue is where can i see the app?
It would great if you can provide some screenshots of the app.
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.