Skip to content

Commit

Permalink
ContainerViewController PostTransitionBehavior PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dmilinski committed Jan 14, 2020
1 parent f8ad598 commit 9f918f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/UtiliKit/Container/ContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ open class ContainerViewController: UIViewController {

// MARK: Subtypes
public enum PostTransitionBehavior {
case removeAllNonVisibleChildren
case removeAllNonVisibleChildrenExcept([AnyHashable])
case none

static var removeAllNonVisibleChildren: PostTransitionBehavior { return .removeAllNonVisibleChildrenExcept([]) }
}

//MARK: Properties
Expand All @@ -32,7 +34,7 @@ open class ContainerViewController: UIViewController {
// MARK: Transitioning
private var containerTransitionContext: UIViewControllerContextTransitioning?
open var containerTransitionCoordinator: ContainerViewControllerTransitionCoordinator?
open var postTransitionBehavior: PostTransitionBehavior?
open var postTransitionBehavior: PostTransitionBehavior = .none

//MARK: Initializers
public convenience init(managedChildren: [ManagedChild], delegate: ContainerViewControllerDelegate? = nil) {
Expand Down Expand Up @@ -170,8 +172,6 @@ private extension ContainerViewController {
}

switch postTransitionBehavior {
case .removeAllNonVisibleChildren:
removeAllNonVisibleChildren(except: [])
case .removeAllNonVisibleChildrenExcept(let identifiers):
removeAllNonVisibleChildren(except: identifiers)
case .none:
Expand Down

0 comments on commit 9f918f5

Please sign in to comment.