Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Explore configuration options for transitions #92

Open
jverkoey opened this issue Apr 12, 2017 · 0 comments
Open

Explore configuration options for transitions #92

jverkoey opened this issue Apr 12, 2017 · 0 comments

Comments

@jverkoey
Copy link
Contributor

We need some mechanism by which call sites can configure view controller transitions. This is likely via the transitionController.

One option:

viewController.transitionController.options = [:]

Another option that's more type-safe would involve requiring that transitions define a config type like so (this is hacked together pseudo-code):

protocol Transition {
  associatedtype Config: TransitionConfig
  init(config: Config)
  func willBeginTransition(withContext ctx: TransitionContext, runtime: MotionRuntime) -> [Stateful]
}
protocol TransitionConfig {
  associatedtype Instance: TransitionInstance
  func transitionType() -> TransitionInstance.Type
}
final class SlideTransition: Transition {
  func willBeginTransition(withContext ctx: TransitionContext, runtime: MotionRuntime) -> [Stateful] {
    
  }
}
final class SlideTransitionConfig: TransitionConfig {
  enum Direction { case up }
  var forwardDirection: Direction = .up

  static func createTransitionInstance() -> SlideTransitionInstance {
    return SlideTransitionInstance()
  }
}

let slideTransition = SlideTransition()
slideTransition.forwardDirection = .up
viewController.transitionController.transition = slideTransition
@jverkoey jverkoey added this to jverkoey (featherless) in Ownership Apr 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Ownership
jverkoey (featherless)
Development

No branches or pull requests

1 participant