[ios]swift textfield 직접 입력하기
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if let text : String = (textField.text as NSString?)?.replacingCharacters(in: range, with: string) as String?
{
print("text -> \(text)")
}
return false
}
return false처리하고... replacingCharacters 등록 시키면 text를 구할 수 있다.. 직접 넣으면 된다..
'ios,swift' 카테고리의 다른 글
[ios] swift dynamic height cell site (0) | 2020.01.30 |
---|---|
[ios] example site (0) | 2020.01.30 |
[ios] swift imageView tag UITapGestureRecognizer 설정방법 (0) | 2020.01.30 |
[ios] uiview child view hide 방법 (0) | 2020.01.30 |
[ios] swift scrollview scroll가능하게 (0) | 2020.01.30 |