본문 바로가기 메뉴 바로가기

KimBaechu

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

KimBaechu

검색하기 폼
  • 분류 전체보기 (151)
    • iOS (88)
    • Swift (32)
    • Git (6)
    • etc. (6)
    • Algorithm (19)
  • 방명록

UIButton (2)
[iOS] iOS15 UIButton, setTitle with RxSwift

iOS 15에서 버튼이 새롭게 바뀌었는데 예시를 들면서 살펴보겠습니다. 일단 간단하게 버튼을 만들어줍니다. private let anyButton: UIButton = { let button = UIButton() // 1) var attString = AttributedString("AnyButton") attString.font = .systemFont(ofSize: 16, weight: .bold) attString.foregroundColor = .systemPink // 2) var configuration = UIButton.Configuration.filled() configuration.attributedTitle = attString configuration.image = UIImage(..

iOS 2022. 2. 11. 16:53
[iOS] Custom UIView에 UIButton Touch 안될 때

코드베이스로 UI를 만들다가 버튼이 안먹히는 케이스가 있어서 잘 모르던 부분을 공유합니다. 화면은 다음과 같습니다. 여기서 C버튼이 제대로 안눌리는 문제가 있었는데요. 회색뷰 위에 노란 뷰를 만들고 노란뷰 안에 a b c 버튼을 추가했습니다. 사실 노란뷰가 색이 없어서 안보이는상태였는데요. 노란뷰에 addSubview를해서 C버튼이 그려진상태인데 C의 아랫부분은 노란뷰에 들어가지 않습니다. 아래 코드를 통해서 터치 이벤트를 확인할 수 있는데요. override func touchesBegan(_ touches: Set, with event: UIEvent?) { print(#function) } C버튼의 아랫부분을 터치하면 touchesBegan(_:with:) 가 출력됩니다. 버튼이 아니라 Custom..

iOS 2022. 1. 15. 13:16
이전 1 다음
이전 다음
공지사항

Blog is powered by Tistory / Designed by Tistory

티스토리툴바