We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VC A->VC B,Now i want get B page value in A Page how should i do?
The text was updated successfully, but these errors were encountered:
You can use context:
context
struct MyContext { let completionHandler: (MyData) -> Void } navigator.register("myapp://") { url, values, context in guard let context = context as? MyContext else { return nil } return ViewControllerB(completionHandler: context.completionHandler) } // in ViewControllerA.swift let context = MyContext(completionHandler: { ... }) navigator.push(viewControllerB, context: context)
Sorry, something went wrong.
You can use context: struct MyContext { let completionHandler: (MyData) -> Void } navigator.register("myapp://") { url, values, context in guard let context = context as? MyContext else { return nil } return ViewControllerB(completionHandler: context.completionHandler) } // in ViewControllerA.swift let context = MyContext(completionHandler: { ... }) navigator.push(viewControllerB, context: context)
push方法有返回viewcontroller,我返回了一个基类,基类内有个公共的闭包,在闭包内实现回调也是可行的吧? 因为我push 的时候把context 仅作为Dictionary 传参处理的,感觉比在url 上传参清晰
No branches or pull requests
VC A->VC B,Now i want get B page value in A Page how should i do?
The text was updated successfully, but these errors were encountered: