mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Fix memory leak
This commit is contained in:
+14
-2
@@ -22,7 +22,7 @@ struct UserSessionNameCoordinatorParameters {
|
||||
let sessionInfo: UserSessionInfo
|
||||
}
|
||||
|
||||
final class UserSessionNameCoordinator: Coordinator, Presentable {
|
||||
final class UserSessionNameCoordinator: NSObject, Coordinator, Presentable {
|
||||
private let parameters: UserSessionNameCoordinatorParameters
|
||||
private let userSessionNameHostingController: UIViewController
|
||||
private var userSessionNameViewModel: UserSessionNameViewModelProtocol
|
||||
@@ -102,7 +102,7 @@ final class UserSessionNameCoordinator: Coordinator, Presentable {
|
||||
|
||||
private func showInfoSheet(parameters: InfoSheetCoordinatorParameters) {
|
||||
let coordinator = InfoSheetCoordinator(parameters: parameters)
|
||||
|
||||
coordinator.toPresentable().presentationController?.delegate = self
|
||||
coordinator.completion = { [weak self, weak coordinator] result in
|
||||
guard let self = self, let coordinator = coordinator else { return }
|
||||
|
||||
@@ -118,3 +118,15 @@ final class UserSessionNameCoordinator: Coordinator, Presentable {
|
||||
toPresentable().present(coordinator.toPresentable(), animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UIAdaptivePresentationControllerDelegate
|
||||
|
||||
extension UserSessionNameCoordinator: UIAdaptivePresentationControllerDelegate {
|
||||
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
||||
guard let coordinator = childCoordinators.last else {
|
||||
return
|
||||
}
|
||||
|
||||
remove(childCoordinator: coordinator)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user