title: swift ios assigning data to multiple alert textfield
body: <p>Hi gooday i wanted to add data which is name , date, details using alert textfield , how is that possible ? , like i wanted to assign those "let" to each textfield input
  code</p>
  
  <pre><code>func addData(){ 
  //Date Formatter 
  let dateFormatter = DateFormatter() 
  dateFormatter.dateFormat = "yyyy/MM/dd" 
  
  let name = "Abhirajsinh" 
  
  let dateAdded = Date() // In Realtime it would come from datePicker 
  let strDateAdded = dateFormatter.string(from: dateAdded) 
  
  let dateExpiration = Date() // In Realtime it would come from datePicker 
  let strDateExpiration = dateFormatter.string(from: dateExpiration) 
  
  let details = "This is demo Detail" 
  
  saveData(name: name, dateAdded: strDateAdded, dateExpiration: strDateExpiration, details: details) // USe it like this 
  
  } 
  
  
  func saveData(name:String,dateAdded:String,dateExpiration:String,details:String){ 
  
  let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext 
  let groceryData = GroceryItem(context: context) // Link GroceryItem &amp; Context 
  groceryData.name = name 
  groceryData.dateAdded = dateAdded 
  groceryData.dateExpiration = dateExpiration 
  groceryData.details = details 
  (UIApplication.shared.delegate as! AppDelegate).saveContext() 
  
  }
  </code></pre>