-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
feedback #1
Conversation
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)] |
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.
backGroundColors は TableViewCell に移動
func configure(name: String, index: Int) { | ||
nameLabel.text = name | ||
commentLabel.text = "\(index + 1)番目の都道府県です" | ||
backgroundColor = backGroundColors[index % backGroundColors.count] |
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.
表示処理は configure メソッドに集約
func getNameLabel() -> UILabel { | ||
return nameLabel | ||
} |
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.
これだと「名前の表示に UILabel を1つ、コメントの表示に UILabel を1つ使っている」という知識を外部に露出させているので、カプセル化の観点からあまり好ましくはないと思います
No description provided.