티스토리 뷰

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import UIKit
 
@IBOutlet weak var mainImageView: UIImageView!
 
override func viewDidLoad() {
    super.viewDidLoad()
 
    mainImageView.image = UIImage(named: "Image.jpg")
    mainImageView.userInteractionEnabled = true
    mainImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "buttonTapped:"))
}
 
func buttonTapped(sender: UITapGestureRecognizer) {
    if (sender.state == .Ended) {
        print("터치 이벤트")
    }
}
cs


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday