How set variable in alamofire and get to another function :     import Alamofire
    import SwiftyJson
    
    public class MyExample{
    
    var myarray=[String]()
    
    func onCreate(){
    Alamofire.request(.GET, "https://myurl.org/get", ).responseJSON {
 response in
                let json = JSON(value)
                let list: Array<JSON> = json.arrayValue
    for element in list{
      myarray.append(element["name"].stringValue)
             }
    
    }
    func getMyArray(){return myarray}
    }

