[iOS swift UIKit] UIView 배경색 랜덤으로 변경하기
[iOS swift UIKit] UIView 배경색 랜덤으로 변경하기 import UIKit class MovieCollectionViewCell: UICollectionViewCell { @IBOutlet weak var backView: UIView! func configureCell(data: Movie) { let backgroundColor: [UIColor] = [.yellow, .systemPink, .lightGray] backView.backgroundColor = backgroundColor.randomElement() } }