GithubHelp home page GithubHelp logo

rerouter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rerouter's Issues

Add URL handling

We need to have a way of using router URL to handle deep linking. The first possible approach would be to provide a dictionary [URL: Path<Root>]. However, we need to have a way of extracting the parameters from the URL.

Performance of the path

Almost all the operations on the path now take O(n) time because it's based on the array.

Move away from RxSwift

We need RxSwift, because Router internally uses it to listen to changes in the path. However, it would be great to make it FRP frameworks ignorant. For this, we will need some basic streams functionality within the router.

Consider default presentations

Some things appear all the time, so we can make them as static functions on the NavigationItem. This issue will have subtasks for each specific implementation

Fix animated

Now all the transitions are animated. However, we need to have rules for determining whether the transition is animated or not

RouteHandler crash

RouteHandler add path crashes if paths are same and the last NavigationItem's target is not Coordinator

Better error messaging

Now error messages are really confusing, as they don't give much information about what has happened. One of the examples is the wrong identifier. We could provide more information of which identifier we expected and which we actually got

Refactor from distinctUntilChanged in router

Basically, we do double work when we do distinctUntilChanged as we after that create the RouteChange that does pretty much the same thing. So we do the same work twice. Instead, we could use the RouteChange and filter for it to be non-empty, as it takes O(1) time

Add demo app in the project

Now it's really not very clear how to use the library only from documentation, so it would be great to create a demo app for this purpose

Does not compile

I get the following output while trying to compile using Carthage:

*** Building scheme "ReRouter" in ReRouter.xcodeproj
Build Failed
        Task failed with exit code 65:
        /usr/bin/xcrun xcodebuild -project /.../Carthage/Checkouts/ReRouter/ReRouter.xcodeproj -scheme ReRouter -configuration Release -derivedDataPath ~/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A255/ReRouter/0.1.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/ns/0h9r9v5908x4x67v5j9wvhvw0000gn/T/ReRouter SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /.../Carthage/Checkouts/ReRouter)

This usually indicates that project itself failed to compile.

Simulator keeps crashing

My iOS Simulator keeps crashing throwing the following error:

ReRouter was compiled with optimization - stepping may behave oddly;
variables may not be available.

Add possibility for silent path change

Some route changes are initiated silently by UIKit. Like when you push back button on the navigation controller. That is why we need to have a way for router to ignore some changes

Could not cast value of type '...ViewController' to 'ReRouter.AnyCoordinator'

In my environment ReRouter v0.1 throws this error, pointing to the following function:

    func add(path: Path<Root.Key>, same: Int) -> [NavigationItem] {
        let initial = same > 0 ? items[same - 1].target : AnyCoordinator(root)
        var result = [NavigationItem]()
        _ = path.sequence[same..<path.sequence.count]
            .lazy.map(AnyIdentifier.init)
            .reduce(initial, { (item, current) in
                let new = (item as! AnyCoordinator).item(for: current) //<---- the error is thrown here
                result.append(new)
                return new.target
            })
        
        return result
    }

And here is the code which does the navigation:

func item(for key: Key) -> NavigationItem{
	switch key{
	case .list:
		let viewController = ListViewController(style: .grouped)
		viewController.store = self.store
		
		return NavigationItem(self, viewController, push: { (animated, source, target, completion) in
			source.controller.pushViewController(target, animated: animated)
			completion()
			
		}, pop: { (animated, source, target, completion) in
			source.controller.popViewController(animated: animated)
			completion()
		})
		
	case .new,.edit,.myCard:
		let viewController = FormViewController()
		viewController.store = self.store

		return NavigationItem(self, viewController, push: { (animated, source, target, completion) in
			source.controller.pushViewController(target, animated: animated)
			completion()

		}, pop: { (animated, source, target, completion) in
			source.controller.popViewController(animated: animated)
			completion()
		})
	}
}

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.