im new in swift. I'd like to ask u if i go the right way.
I have something like this:
class ViewController: UIViewController {
struct myVars {
var static short_text = ""
}
override func viewDidLoad() {
super.viewDidLoad()
loadData()
println(short_text)
}
func loadData() {
myVars.short_text = "Hello world!"
}
}
This code works. I have "Hello world!" string in the variable and i can print it. But iam asking you if this is a good and clear way to redefine static var? I do it because i want to work with this variable across the code.
Thank you for your answers.
PS: The final methods are much more difficult. This is shorted code for example only.