title: Swift append array value not showing outside statement
body: <p>My scenario from my get call I received values and I appended with <code>var nameData = [String]()</code> array. nameData array values not showing outside statement. Please check my below code </p>
  
  <pre><code>// Global Declarions
  var nameData = [String]()
  
  // GET Call values append
   if let content = result["contacts"] as? [[String:AnyObject]] {
              for category in content {
  
                  self.nameData.append(category["name"] as! String)
              }
              print(self.nameData) // here I am getting
          }
      }
     self.addDropDown()
     print(self.nameData) // Empty array showing
  </code></pre>
  
  <p>Now, My dropdown code below, Here I want to assign <code>nameData</code> array </p>
  
  <pre><code>func addDropDown(){
  
     print(self.nameData) // Empty array showing why???
  
          // For Top textField
          let dropDownTop = VPAutoComplete()
          dropDownTop.dataSource =  self.nameData           --&gt;// Here I need to assign nameData values if i do its showing empty values.
          dropDownTop.onTextField = emailTF
          dropDownTop.onView = self.view
          dropDownTop.show { (str, index) in
              print("string : \(str) and Index : \(index)")
              self.emailTF.text = str
          }
  }
  </code></pre>