[Swift] Notebook

Swift 키보드 내리기 예제 코드

Dev2DHs 2016. 4. 20. 22:45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 터치시 키보드 내려가기
import UIKit
 
class ViewController: UIViewController {
    
    @IBOutlet weak var textviews: UITextView!
 
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }
 
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
 
    // 터치시 키보드 내려가기
    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
        textviews.resignFirstResponder()
        
    }
}
 
cs