QuickBirdEng / XCoordinator

🎌 Powerful navigation library for iOS based on the coordinator pattern
MIT License
2.27k stars 179 forks source link

New to this #189

Closed cilman closed 3 years ago

cilman commented 4 years ago

Hi, Im new to XCoordinator, im using it with viper and loved

I dont know where to ask questions so im writing here

  1. How can i prevent default transition animation, for ex : return .pop() is animating but i dont want it.
  2. How can i change default right to left transition animation to bottom to up, like we did it using standart VC push.

Thanks.

pauljohanneskraft commented 4 years ago

Hey - glad you like it 😊

  1. You can disable the transition when triggering a route, i.e. call router.trigger(.someRoute, with: TransitionOptions(animated: false)) instead of just router.trigger(.someRoute)
  2. You can specify an Animation object with most of the available transitions (e.g. Transition.push). Have a look at this folder for some examples and take a look at the code documentation - if you have any questions, feel free to comment here or open another issue.
cilman commented 4 years ago

Thanks for the answers, but i have some more issues

  1. I still can't use your advise on router.pop() . it doesn't have "with" option.
  2. Im using router.trigger(.initial, on: aCoordinator) and it has no with too.

I think i can use Transitions with number 2 above , i expect it to solve numaber 1 ( .pop() ) too , am i right? I mean if I can an "do nothing" animation as dismissal animation, is that works?

pzmudzinski commented 4 years ago

@cilman I think API for passing options in trigger(... on: ...) is missing. You can add it by yourself:

extension Transition {
    public static func trigger<R: Router>(_ route: R.RouteType, on router: R, options: TransitionOptions) -> Transition {
        Transition(presentables: [], animationInUse: nil) { _, _, completion in
            router.trigger(route, with: options, completion: completion)
        }
    }
}