[Swift 4] 문자열 (String) - 길이 (Length) 문자열 길이 (Length) Swift 4 let str = "hello" str.count // -> 5 엑스코드(Xcode)/Swift 4 2018. 12. 22. 21:44 [Swift 4] Action Sheet - UIAlertController OK + Cancel Swift 4 func actionSheet() { let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) let action = UIAlertAction(title: "OK", style: .default) { (action) in // Action Code } sheet.addAction(action) let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) sheet.addAction(cancel) present(sheet, animated: true, completion: nil) } Title + mes.. 엑스코드(Xcode)/Swift 4 2018. 12. 20. 00:12 [Swift 4] 경고창 (Alert) - UIAlertController UIAlertController - Apple Developer Documentation Swift // MARK: UIAlertController - Apple Developer Documentation let alert = UIAlertController(title: "My Alert", message: "This is an alert.", preferredStyle: .alert) alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Default action"), style: .default, handler: { _ in NSLog("The \"OK\" alert occured.") })) self.present(alert,.. 엑스코드(Xcode)/Swift 4 2018. 12. 19. 23:14 [Swift 4] 키보드 내리기 (hideKeyboard) - dismissKeyboard TextField 이외에 부분에 Tap하면, 키보드 내리기. ViewContoller.swift (Swift 4) class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.hideKeyboard() // 엑스코드(Xcode)/Swift 4 2018. 12. 2. 18:14