Skip to content

Commit

Permalink
Merge pull request #46 from BottleRocketStudios/containerFixes
Browse files Browse the repository at this point in the history
Another fix for pre-load transitions
  • Loading branch information
tylermilner committed Dec 20, 2018
2 parents 05e5e8f + f6b3804 commit 8df63ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

##### Bug Fixes

* None.
* Handle another case of transitioning pre-load.
[Will McGinty](https://github.com/willmcginty)
[#46](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/46)


## 1.3.4 (2018-12-19)
Expand Down
5 changes: 5 additions & 0 deletions Sources/UtiliKit/Container/ContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ extension ContainerViewController {
managedChildren.insert(child, at: managedChildren.startIndex)
}

if !isViewLoaded, managedChildren.first?.identifier != child.identifier {
managedChildren.removeAll { $0.identifier == child.identifier }
managedChildren.insert(child, at: managedChildren.startIndex)
}

transition(to: child.viewController, completion: completion)
}

Expand Down

0 comments on commit 8df63ec

Please sign in to comment.