Using Swift, how do I get the input from a
Yes, your approach of creating an
IBOutlet from the storyboard and referencing it using
self.myInput.text is a standard way of accessing this field in Swift.
As for whether to use
myInput, I prefer to always write
self because it is very obvious that the variable is a property and will probably be changed in many different places (opposed to a local var). Also, once you have
self there, you don't have to worry about introducing local vars with the same name or making changes if you copy and paste a block of code into a closure that requires self.