Im trying to access a variable defined in one class from two other viewControllers. In java I would set the variable as static then I could access it as variables.varOne. Since class variables in Swift are not currently functioning is there a way to accomplish this?
(Example code)
class variables
{
var varOne = 1
}
class viewController1
{
func addTwo() //Linked to a button
{
variables.varOne += 2
}
}
class viewController2
{
func addThree //Linked to a button
{
variables.varOne += 3
}
}
Thanks in advance for the help!