how to get text from button swift code example
Example 1: swift change button text
button.setTitle("Button Title",for: .normal)
Example 2: swift compare string to button title
if myButton.currentTitle == "myString" {
// Do something
}
Example 3: How to set back button text in Swift
let backButton = UIBarButtonItem()
backButton.title = "name"
self.navigationController?.navigationBar.topItem?.backBarButtonItem = backButton