Look, I had the same problem, but I am inserting a function as a global variable
as
var RNumber = Int(arc4random_uniform(9)+1) func GetCase(){ your code }
obviously this is inefficient, so I just copy and paste the code into the function so that it can be reused, then xcode will ask me to set the variable as a constant so that my code is
func GetCase() { let RNumber = Int(arc4random_uniform(9)+1) if categoria == 1 { } }
Well, this is part of my code, so xcode will tell me something about inmutable and initialization, but still it creates the application, and this advice just disappears
hope this helps
Parada11.04 Sep 18 '15 at 20:27 2015-09-18 20:27
source share