UITextView
에 특정 검색 키워드를 사용하여 사용자가 "@"을 입력 할 때 드롭 다운 목록을 표시 할 수있는 방법이 있습니까? 예를 들어사용자 유형이 '@'일 때 목록에서 데이터 검색 UITextView의 기호
:
유형 "@ios"하고 드롭 다운 목록에서 목록 쇼에서 단어 "IOS"필터가 포함 된 모든 문자열입니다.
func textView(_ textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool {
if (textView.text.appending(text) == "@") {
//trigger '@' operation
if arrayObject.contains(value) {
//Populate array and display tableview.
}
}
else if (textView.text.appending(text) == "/") {
//trigger/operation
}
//Same conditions go on
}
귀하의 요구 사항에 따라 다음 링크를 살펴보십시오. https://github.com/EddyBorja/MLPAutoCompleteTextField https://www.raywenderlich.com/336/auto-complete-tutorial-for-ios-how-to-auto-complete-with-custom-values – Venkat