티스토리 뷰

728x90
반응형

UIImageView UITapGestureRecognizer 로 액션설정하기

// MARK: - @IBOutlet Properties
@IBOutlet var loginImageView: UIImageView!

//...

// MARK: - Methods
func loginTapAction() {
    let login = UITapGestureRecognizer(target: self, action: #selector(login))
    loginImageView.isUserInteractionEnabled = true
    loginImageView.addGestureRecognizer(login)
}

// MARK: - @objc Methods
@objc
func login() {
    guard let nextVC = UIStoryboard(name: Const.Storyboard.Name.FirstOnboarding, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Name.FirstOnboarding) as? FirstOnboardingVC else {
        return
    }

    self.navigationController?.pushViewController(nextVC, animated: true)
}
728x90
반응형
댓글
최근에 올라온 글
최근에 달린 댓글
글 보관함
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
링크
Total
Today
Yesterday