iosswiftuitoolbar

How to remove toolbar?


I want to hide toolbar when a specific row is selected

This is the code if specific row in pickers is selected, show keyboard and input characters

if self.emailPickers[row] == "input by myself" {
            email2Field.text = ""
            email2Field.resignFirstResponder()
            email2Field.inputView = nil
            

I want to remove or hide the toolbar

Please help me


Solution

  • You can use the same property for adding and removing the toolbar.

    email2Field.inputAccessoryView = nil