This repository was archived by the owner on Mar 1, 2023. It is now read-only.
Open
Conversation
Loupehope
suggested changes
Jun 3, 2021
|
|
||
| func push(_ module: Presentable?) | ||
| func push(_ module: Presentable?, | ||
| completion: (() -> ())?) |
| completions.removeValue(forKey: controller) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) { | ||
| guard let poppedViewController = navigationController.transitionCoordinator?.viewController(forKey: .from), |
There was a problem hiding this comment.
Можно добавить ссылку на источник проблемы и более подробное решение? Так как на первый взгляд неочевидно, что именно здесь пытаемся добиться.
Contributor
There was a problem hiding this comment.
В мои времена это делалось через CATransaction setCompletionBlock кхе-кхе
https://stackoverflow.com/a/27229945
| import UIKit | ||
|
|
||
| open class StackRouter: StackRoutable { | ||
| open class StackRouter: NSObject, StackRoutable, UINavigationControllerDelegate { |
There was a problem hiding this comment.
Определение себя делегатом навигейшен контроллера в StackRouter убивает подписку в кастомной реализации UINavigationController в проекте. Кажется, это совершенно не очевидное поведение библиотеки
petropavel13
approved these changes
Jun 4, 2021
| } | ||
|
|
||
| public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) { | ||
| guard let poppedViewController = navigationController.transitionCoordinator?.viewController(forKey: .from), |
Contributor
There was a problem hiding this comment.
В мои времена это делалось через CATransaction setCompletionBlock кхе-кхе
https://stackoverflow.com/a/27229945
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Pop problem" - pressing the "back" button of the navigation controller closes the screen, but the coordinator isn't destroyed
Example: The first flow screen must be added like this
router.push(module) { [weak self] in
self?.finishFlow()
}