Skip to content

Navigation Controller Delegate not working #255

Description

@phuongddx
    case root
}

final class CommunitiesCoordinator: NavigationCoordinator<CommunitiesRoute> {
    init() {
        super.init(initialRoute: .root)
        delegate = RootNavigationControllerDelegateWrapper()
    }

    override func prepareTransition(for route: CommunitiesRoute) -> NavigationTransition {
        switch route {
            case .root:
                let rootVc = CommunitiesViewController()
                return .push(rootVc)
        }
    }
}

final class RootNavigationControllerDelegateWrapper: NSObject,
                                                     UINavigationControllerDelegate {
    func navigationController(_ navigationController: UINavigationController,
                              willShow viewController: UIViewController,
                              animated: Bool) {
        print("🚀 Will show: \(type(of: viewController))")
    }
    
    func navigationController(_ navigationController: UINavigationController,
                              didShow viewController: UIViewController,
                              animated: Bool) {
        print("✅ Did show: \(type(of: viewController))")
    }
}

I have simple routing like that, but look like delegate func not to be call, could you guys help me check on it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions