mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Coordinator stops (#207)
* Add `stop` method to `Coordinator` * Use new stop method to cleanup room screen * Call stop implicitly when removing a child coordinator * Revert placeholder avatar font change * Fix PR remarks
This commit is contained in:
@@ -36,6 +36,9 @@ protocol Coordinator: AnyObject {
|
||||
///
|
||||
/// - Parameter childCoordinator: Child coordinator to remove.
|
||||
func remove(childCoordinator: Coordinator)
|
||||
|
||||
/// Stops job of the coordinator. Can be used to clear some resources. Will be automatically called when the coordinator removed.
|
||||
func stop()
|
||||
}
|
||||
|
||||
// `Coordinator` default implementation
|
||||
@@ -45,6 +48,7 @@ extension Coordinator {
|
||||
}
|
||||
|
||||
func remove(childCoordinator: Coordinator) {
|
||||
childCoordinator.stop()
|
||||
childCoordinators = childCoordinators.filter { $0 !== childCoordinator }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user