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

feedback #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feedback #1

wants to merge 1 commit into from

Conversation

akio0911
Copy link

No description provided.

Comment on lines -21 to -23
private let backGroundColors = [UIColor(red: 255/255, green: 209/255, blue: 208/255, alpha: 1),
UIColor(red: 222/255, green: 246/255, blue: 154/255, alpha: 1),
UIColor(red: 203/255, green: 216/255, blue: 255/255, alpha: 1)]
Copy link
Author

Choose a reason for hiding this comment

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

backGroundColors は TableViewCell に移動

Comment on lines +18 to +21
func configure(name: String, index: Int) {
nameLabel.text = name
commentLabel.text = "\(index + 1)番目の都道府県です"
backgroundColor = backGroundColors[index % backGroundColors.count]
Copy link
Author

Choose a reason for hiding this comment

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

表示処理は configure メソッドに集約

Comment on lines -14 to -16
func getNameLabel() -> UILabel {
return nameLabel
}
Copy link
Author

Choose a reason for hiding this comment

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

これだと「名前の表示に UILabel を1つ、コメントの表示に UILabel を1つ使っている」という知識を外部に露出させているので、カプセル化の観点からあまり好ましくはないと思います

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

Successfully merging this pull request may close these issues.

1 participant