하다보면 버튼이 꼭 아니더라도 체스처를 통해 버튼처럼 기능을 넣어야 하는 상황이 생길수도 ~
그래서 만들어봤다.
let tapGestureForImage = UITapGestureRecognizer(target: self, action: #selector(showImageOptions))
editProfileView.profileImageView.isUserInteractionEnabled = true
editProfileView.profileImageView.addGestureRecognizer(tapGestureForImage)
editProfileView.profileImageButton.addTarget(self, action: #selector(showImageOptions), for: .touchUpInside)
이렇게 하면 이미지뷰 터치하면 함수이 있는 기능들이 활성화된다 ~
앞으로도 잘 사용해보자
반응형
'코딩' 카테고리의 다른 글
swift userdefaults 데이터 저장하기 (0) | 2024.09.13 |
---|---|
swift 프로토콜로 데이터 업데이트 하기 ~ (0) | 2024.09.11 |
swfit 키패드 위쪽에 자동 텍스트 완성 기능 제거하기~ (0) | 2024.09.11 |
swfit 키패드 자동완성 자동수정 비활성화 하기 (0) | 2024.09.11 |
swfit 키패드 done cancel 버튼 만들기 ~ (0) | 2024.09.11 |