나는 내 코드가 작동하지 않는 이유를 아무 생각이 이미지 뷰 (나는 그것을 볼 수 있습니다)AddGesture Swift 3에서 다른가요?
func handleSelectProfileImageView() {
print("123")
}
그러나 아무것도 콘솔에 반환 얻는있는 viewDidLoad에로드
let profileImageView: UIImageView = {
let image = UIImageView()
image.image = UIImage(named: "gameofthrones_splash")
image.translatesAutoresizingMaskIntoConstraints = false
image.contentMode = .scaleAspectFill
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleSelectProfileImageView))
image.addGestureRecognizer(tapGesture)
image.isUserInteractionEnabled = true
return image
}()
때 그것에 두드리고있어! WTF?
시도 - – Gyanendra
무엇을 의미합니까? – petaire
image = UIImageView()에서 viewDidLoad와 같은 다른 곳에 넣고이 메서드 내에서 이미지 변수를 사용합니다. – Gyanendra