버튼에 selected 상태의 이미지가 별도로 있는 경우 highlighted 이미지를 selected 이미지로 설정하기
override var isSelected: Bool {
didSet {
if isSelected {
if let img = self.image(for: .selected) {
self.setImage(img, for: UIControl.State.selected.union(.highlighted))
}
}
}
}
'프로그래밍 > iOS,macOS' 카테고리의 다른 글
[Metal] 이미지 렌더링~ 텍스처에 렌더링 (0) | 2021.02.05 |
---|---|
[Metal] 이미지 렌더링~ 텍스처 표시 (0) | 2021.02.03 |
[Metal] 이미지 렌더링~ 사각형 그리기 (0) | 2021.02.03 |
[Metal] AR 얼굴인식 및 obj 렌더링 (0) | 2021.01.16 |
[Metal] Render to Texture (0) | 2020.12.27 |
CaptureSession 카메라, 마이크 (0) | 2020.07.10 |
Codable for Dictionary (0) | 2020.06.10 |
UITableView , UICollectionView (1) | 2020.04.14 |
[iOS] 키보드를 따라 올라오는 뷰 (0) | 2020.04.08 |
[iOS] Google SignIn (0) | 2020.03.30 |