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

Add EmptyView #18

Closed
wants to merge 1 commit into from
Closed

Add EmptyView #18

wants to merge 1 commit into from

Conversation

zzzarya
Copy link
Collaborator

@zzzarya zzzarya commented Apr 20, 2023

  • Создана EmptyView
  • Вместо картинки оставил емоджи папки. Поменяю, если предложите картинку)), я не смог пока придумать какую
    image

@zzzarya zzzarya added the enhancement New feature or request label Apr 20, 2023
@zzzarya zzzarya self-assigned this Apr 20, 2023
@zzzarya zzzarya linked an issue Apr 20, 2023 that may be closed by this pull request
Copy link
Collaborator

@SShliakhin SShliakhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом как собирать вьюхи ты понял, не хватает публичного метода update, который принимает картинку и текст.
Вьюху положи в библиотеку рядом с ErrorView
Тебе также нужна моделька EmptyInputData

Comment on lines +11 to +12
private lazy var emptyPictureLabel = makeEmptyPictureLabel()
private lazy var emptyTextLabel = makeEmptyTextLabel()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по структуре все гуд, как я хочу ленивый элемент = функция make из расширения

  • наименование можно проще - опционал
  • нужна картинка!

stackContainer.axis = .vertical
stackContainer.distribution = .fill
stackContainer.alignment = .center
stackContainer.spacing = 16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing надо использовать из Theme
stackContainer.spacing = Theme.spacing(usage: .standard2)
мой косяк дал пример, а сам в нем не избавился от магический цифр

Comment on lines +67 to +70
top: 0,
left: 16,
bottom: 16,
right: 16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь тоже из темы

func makeEmptyTextLabel() -> UILabel {
let label = UILabel()
label.textColor = Theme.color(usage: .gray)
label.text = "Empty folder"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если используешь внутренний текст (объявлен внутри класса), то используй такой вариант:

// MARK: - Appearance
private extension AboutViewController {
	enum Appearance {
		static let welcomeText = "Welcome to About"
		static let title = "About"
	}
}

и используй как label.text = Appearance.welcomeText

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но этого тебе здесь не надо, нам нужна вьюха, которая принимает картинку и текст.

@zzzarya zzzarya closed this Apr 20, 2023
@zzzarya zzzarya deleted the M3L1/feature/10-create-EmptyView branch April 20, 2023 16:46
@zzzarya zzzarya removed a link to an issue Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants