lazy var profileImageView: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = UIImage(named: "1")
imageView.contentMode = .scaleAspectFill
imageView.isUserInteractionEnabled = true
imageView.addGestureRecognizer(UIGestureRecognizer(target: self, action: #selector(handleSelectedProfileImage)))
return imageView
}()
@objc func handleSelectedProfileImage() {
print("fff")
}
I follow the instruction on Youtube to set the action for uiimageView, but it can not print anything from the function, do not know what happen