Hi everyone. I am Ryan Jin. Yesterday I was working on an app and had trouble passing data between view controllers. Today, I found an easy way. If you don't want to watch the forteen-minute-video. I'll just tell you this:
You can declare your variable outside your class to allow any file in your project to access it.
So you can do
//Below this is the code
import UIKit
var thisIsMyVariable: String?
class ViewController: UIViewController
{
//functions and methods and properties
}
//Code end, above this is the code
And this allows other files to access it? For further information, please check out this video
You can declare your variable outside your class to allow any file in your project to access it.
So you can do
//Below this is the code
import UIKit
var thisIsMyVariable: String?
class ViewController: UIViewController
{
//functions and methods and properties
}
//Code end, above this is the code
And this allows other files to access it? For further information, please check out this video