-
Notifications
You must be signed in to change notification settings - Fork 43
Created the ActivityDetailsView screen #77
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
base: main
Are you sure you want to change the base?
Created the ActivityDetailsView screen #77
Conversation
return stack | ||
}() | ||
|
||
private lazy var productView: UIView = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dá pra resumir com uma inicialização simples
private lazy var mainStack: UIStackView = { | ||
let stack = UIStackView() | ||
stack.axis = .vertical | ||
stack.distribution = .fillEqually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aqui dá pra remover já que os componentes tem instrinsicContentSize
return view | ||
}() | ||
|
||
private lazy var productValueView: UIView = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mesma coisa
private lazy var productNameLabel: UILabel = { | ||
let label = UILabel() | ||
label.textAlignment = .center | ||
label.font = UIFont.boldSystemFont(ofSize: 17) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dá pra salvar o tamanho da fonte numa constante
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outra coisa: Se a label comportar conteúdo grande, bom setar o número de linhas como zero.
return label | ||
}() | ||
|
||
private lazy var categoryNameLabel: UILabel = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mesma coisa aqui
return label | ||
}() | ||
|
||
private lazy var productValue: UILabel = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renomear pra productValueLabel
|
||
private lazy var productValue: UILabel = { | ||
let label = UILabel() | ||
label.font = UIFont.boldSystemFont(ofSize: 34) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Salvar em constantes
|
||
private lazy var reportButton: UIButton = { | ||
let button = UIButton() | ||
button.layer.cornerRadius = 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Salvar em Constants
private lazy var reportButton: UIButton = { | ||
let button = UIButton() | ||
button.layer.cornerRadius = 14 | ||
button.backgroundColor = .systemBlue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acho que seria bom usar a classe de botão que o Thyago criou.
let button = UIButton() | ||
button.layer.cornerRadius = 14 | ||
button.backgroundColor = .systemBlue | ||
button.setTitle("Report a issue", for: .normal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Salvar a string numa constante
}() | ||
|
||
override var hierarchies: [BaseViewHierarchy] { | ||
return [BaseViewHierarchy.init(parentView: self, subViews: [mainStack, reportButton]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OBS: Não precisa do return
BaseViewHierarchy.init(parentView: productValueView, subViews: [productValue, purchaseTime])] | ||
} | ||
|
||
override var constraints: [NSLayoutConstraint] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Salvar as constantes das constraints em Constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pular linha e deixar um comentário pra cada componente que adiciona constraints.
|
||
productImage.centerXAnchor.constraint(equalTo: centerXAnchor), | ||
|
||
productNameLabel.centerXAnchor.constraint(equalTo: centerXAnchor), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sempre é bom colocar além do centro da label os limites.
reportButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 20), | ||
reportButton.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -15), | ||
reportButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -20), | ||
reportButton.heightAnchor.constraint(equalToConstant: 56) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O botão poderia ter um intrinsicContentSize
.
Description
Created the ActivityDetailsView screen 📝
Videos
Simulator.Screen.Recording.-.iPhone.14.-.2022-12-12.at.17.23.58.mp4