Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

textchange in textview swift

class ViewController: UIViewController, UITextViewDelegate { //If your class is not conforms to the UITextViewDelegate protocol you will not be able to set it as delegate to UITextView

    @IBOutlet weak var bodyText: UITextView!

    override func viewDidLoad() {
        super.viewDidLoad()
        bodyText.delegate = self //Without setting the delegate you won't be able to track UITextView events
    }

    func textViewDidChange(_ textView: UITextView) { //Handle the text changes here
        print(textView.text); //the textView parameter is the textView where text was changed
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: pop last element array swift 
Swift :: swift post request 
Swift :: dark mode change immediately swift 
Swift :: IOS create UIAlertViewController programmatically 
Swift :: unit testing swift ui 
Swift :: and in swift 
Swift :: string to double swift 
Swift :: react native ios rtl 
Swift :: get day difference between two dates swift 
Swift :: swift navigation bar title color 
Swift :: swift add width/height constraint to view 
Swift :: swift calendar components 
Swift :: rxswift combine two observables 
Swift :: swift pop view controller 
Swift :: navigationbarhidden not working swiftui 
Swift :: swift remove value dictionary 
Swift :: ForEach tabs swiftui 
Swift :: Swift Closures as Function Parameter 
Swift :: debounce in swift 
Swift :: Swift Swift Function Return Values 
Swift :: struct vs class in swift 
Swift :: Modifying Value Types from Method Swift 
Swift :: swift how to wait in a loop 
Swift :: table flutter stackoverflow 
Swift :: Swift convenience Initializer 
Swift :: swift ranges 
Swift :: Iterate Over enum Cases Swift 
Swift :: Swift Comparison Operators 
Swift :: Named Associated Values Swift 
Swift :: Swift Deinitialization 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =