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

Именование Delegate #6

Open
clmct opened this issue Jan 17, 2022 · 0 comments
Open

Именование Delegate #6

clmct opened this issue Jan 17, 2022 · 0 comments

Comments

@clmct
Copy link
Owner

clmct commented Jan 17, 2022

ChooseImageActionSheetDelegate

Именовать Delegate неправильное. Правильное и согласованное именование делает код читаемым.

protocol ChooseImageActionSheetDelegate {
    @available(iOS 14, *)
    func PHPickerDelegate() -> PHPickerViewControllerDelegate
    func imagePickerDelegate() -> (UIImagePickerControllerDelegate & UINavigationControllerDelegate)
    func presentAction(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?)
}

func presentAction(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?) должно быть func сhooseImageActionSheet(_ viewController: сhooseImageActionSheet, _ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?)

UserCardViewModelDelegate

protocol UserCardViewModelDelegate {
    func onCardTap(user: User)
}

Аналогично func onCardTap(user: User) -> func UserCardViewModel(_ viewModel, with user: User)
Так же поправить в других местах. Хорошея статья на эту тему

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