UILabel
을 포함하는 UIView
클래스가 있습니다. UILabel
에 UITapGestureRecognizer
을 추가했으며 performSegue
을 입력하여 UILabel
의 탭에 새로운 UIViewController
을 엽니 다. UIView
클래스에 performSegue
을 사용할 수 없다는 것이 문제입니다.swift에서 UIView 클래스의 performSegue를 사용하는 방법 3
누구나 UIView
클래스에 performSegue
을 사용할 수 있습니까?
, 내 tapFunction에서 지금
nameLabel.isUserInteractionEnabled = true
let tap = UITapGestureRecognizer(target: self, action: #selector(tapFunction))
tap.numberOfTapsRequired = 1
tap.numberOfTouchesRequired = 1
tap.isEnabled = true
nameLabel.addGestureRecognizer(tap)
,
func tapFunction(sender:UITapGestureRecognizer) {
print("tap working")
self.performSegue(withIdentifier: "memberSegue", sender: self)
}
는하지만 오류 얻을 : 그대로
"Value of type UIViewController has no member performSegue"
을 UIView 클래스.
현재 시도하고있는 코드를 표시 할 수 있습니까? –
코드 공유 UIView 클래스 –