I need to perform a GET request as attribute (outside viewDidLoad() ) in order to access some filed in other function. This is what I tried:
var my_id: Int!
var note: [String]? {
didSet{
let x = service()
x.getStuff(id: my_id ) { (response, error) in
note = response?.results
}
}
}
I'm a beginner and I don't know how to do this. (I know this is not working) My_id is here with a performSegue from another view. Thank you!