Skip to content
New issue

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

navigationController? #17

Open
clmct opened this issue Jan 17, 2022 · 1 comment
Open

navigationController? #17

clmct opened this issue Jan 17, 2022 · 1 comment

Comments

@clmct
Copy link
Owner

clmct commented Jan 17, 2022

No description provided.

@clmct
Copy link
Owner Author

clmct commented Jan 17, 2022

Такие вещи navigationController?.navigationBar.isUserInteractionEnabled = true лучше отдавать NavigationController, так как обращение к navigationController? из ViewController нарущает прицип SRP. ViewController не должен знать и настривать navigationController. Для этого он может делегировать (ссылка) эту работу NavigationController классу, который есть в проекте. С использованием паттерна Coordinator, эта цепочка выглядит следующим образом ViewController -> ViewModel -> Coordinator. Те ViewController вызывает метод ViewModel, а ViewModel через делегат дергает Coordinator, еоторый содержит ссылку на NavigationController (смотреть замечание по архитектуре)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant