Code Monkey home page Code Monkey logo

counterexample-navigation-timetravel's Introduction

Swift 5.0 License

ReSwift Counter Example

An extremely simple example app, being built with ReSwift.

Installation

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

counterexample-navigation-timetravel's People

Contributors

ben-g avatar divinedominion avatar eyrefree avatar yamoridon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

counterexample-navigation-timetravel's Issues

How to compile?

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)

Lots of Errors When Trying to Use This Project

Hi, I tried following in the guide in the README, but I'm getting lots of errors.

Here's what I did:

  1. cloned the repo

  2. 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! ❤️

Update required

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

Where to draw the line?

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?

App Crashes on Launch

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

"An extremely simple example app, being built with ReSwift" - not really ;-)

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?

Where to view the demo of the app

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.