본문 바로가기 메뉴 바로가기

iOS 개발 이야기

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

iOS 개발 이야기

검색하기 폼
  • 분류 전체보기 (6)
    • iOS (6)
      • UIApplication (3)
      • UITextField (1)
      • Extension (1)
      • WKWebView (1)
  • 방명록

UITextFiled (1)
iOS 입력 한글 글자수 제한

UITextFiled나 UITextView에서 입력 글자 제한을 해야되는 경우가 있다. UITextFieldDelegate의 shouldChangeCharactersIn 메서드를 이용해서 아래와 같이 사용하는게 보통의 경우이다.기존 textField의 텍스트와 새로 입력 받은 string을 합쳐서 길이를 제한하는 코드이다. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { guard let text = textField.text as NSString? else {return false} let newString = text.repl..

iOS/UITextField 2017. 8. 4. 14:16
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • swift
  • UIApplication
  • Notification Service Extension
  • Easy APNs Provider
  • 앱 아이콘
  • iOS10
  • UNUserNotificationCenterDelegate
  • AppIcon
  • iOS Keys
  • WebSiteDataStore
  • httpCookieStore
  • UITextFieldTextDidChange
  • ios
  • setAlternateIconName
  • whose view is not in the window hierarchy
  • presentedViewController
  • UITextFiled
  • UNUserNotificationCenter
  • 리치 푸시
  • 인증 키
  • apns
  • 이미지 푸시
  • NotificationCenter
  • mutable-content
  • shouldChangeCharactersIn
  • wkwebview
  • appDelegate
  • swift3
  • UITextFieldDelegate
  • Create a New Key
more
«   2025/06   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바