Fix remaining retain cycles, allow coordinators to be weakly referenced and make sure the NavigationStackCoordinator cleans up after itself

This commit is contained in:
Stefan Ceriu
2023-02-02 10:15:31 +02:00
committed by Stefan Ceriu
parent 93997efef9
commit 594f6f85dd
14 changed files with 63 additions and 36 deletions
@@ -16,9 +16,13 @@
import SwiftUI
struct ActivityCoordinator: CoordinatorProtocol {
class ActivityCoordinator: CoordinatorProtocol {
let items: [Any]
init(items: [Any]) {
self.items = items
}
func toPresentable() -> AnyView {
AnyView(UIActivityViewControllerWrapper(activityItems: items)
.presentationDetents([.medium])
@@ -16,9 +16,13 @@
import SwiftUI
struct InviteFriendsCoordinator: CoordinatorProtocol {
class InviteFriendsCoordinator: CoordinatorProtocol {
let userId: String
init(userId: String) {
self.userId = userId
}
func toPresentable() -> AnyView {
guard let permalink = try? PermalinkBuilder.permalinkTo(userIdentifier: userId).absoluteString else {
return AnyView(EmptyView())
@@ -16,7 +16,7 @@
import SwiftUI
struct SplashScreenCoordinator: CoordinatorProtocol {
class SplashScreenCoordinator: CoordinatorProtocol {
func toPresentable() -> AnyView {
AnyView(
ZStack {