title: want to save data in nsuserdefault and transfer it into table view of another controller
body: <p>I have a detailviewcontroller file in which I have an imageview a textfield, a textview, a date picker. image view image is getting me from first controller. when i fill up rest data like textfield, textview, select date, then when I click on save button in navigation bar then the data should be saved in nsuserdefault and pass onto tableview of another controller. again when I start the app and fill the details again then that data plus previous data should also be there. don't know how to do</p>
  
  <p>my storyboard :
  <a href="https://i.stack.imgur.com/eh8ZK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eh8ZK.png" alt="storyboard file"></a></p>
  
  <p>my detailviewcontroller file:</p>
  
  <pre><code>class DetailsViewController: UIViewController{
  
      var picker : UIDatePicker = UIDatePicker()
  
      @IBOutlet weak var selectedDate: UIButton!
      @IBOutlet weak var detailsVCImage: UIImageView!
  
      @IBOutlet weak var geoAddressLabel: UILabel!
      @IBOutlet weak var titleTF: UITextField!
      @IBOutlet weak var notesTextView: CustomTextView!
  
      var mapView:GMSMapView!
      var transferedImage:UIImage!
  
      var arrayList = [[String:Any]]()
      var obj = [String:Any]()
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          notesTextView.text = "Please enter Notes...."
          notesTextView.textColor = .lightGray
  
  
          detailsVCImage.image = transferedImage
  
          hideKeyboardWhenTapped()
      }
  
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          dismiss(animated: true)
      }
  
  
      @IBAction func datePickerTapped(_ sender: Any) {
  
          picker.datePickerMode = UIDatePickerMode.dateAndTime
          picker.addTarget(self, action: #selector(dueDateChanged(sender:)), for: UIControlEvents.valueChanged)
  //        self.picker = UIDatePicker(frame:CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 85))
  
          let pickerSize : CGSize = picker.sizeThatFits(CGSize.zero)
          picker.frame = CGRect(x:0.0, y:442, width:pickerSize.width, height:85)
          //width: 288
          self.view.addSubview(picker)
  
      }
  
      @objc func dueDateChanged(sender:UIDatePicker){
          let dateFormatter = DateFormatter()
          dateFormatter.dateStyle = .short
          dateFormatter.timeStyle = .short
          selectedDate.setTitle(dateFormatter.string(from: sender.date), for: .normal)
  
      }
  
      override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) {
          picker.removeFromSuperview()
      }
  
      @IBAction func saveDataTaopped(_ sender: Any) {
          obj["title"] = titleTF.text
          obj["notes"] = notesTextView.text
          obj["image"] = transferedImage
          obj["date"] = selectedDate
  
          arrayList.append(obj)
  
      }
  
      func reverseGeocodeCoordinate(_ coordinate: CLLocationCoordinate2D) {
          let geocoder = GMSGeocoder()
  
          geocoder.reverseGeocodeCoordinate(coordinate) { response, error in
              //            self.geoAddressLabel.unlock()
  
  
              guard let address = response?.firstResult(), let lines = address.lines else {
                  return
              }
  
              self.geoAddressLabel.text = lines.joined(separator: "\n")
  
              let labelHeight = self.geoAddressLabel.intrinsicContentSize.height
              ////            self.mapView.padding = UIEdgeInsets(top: self.view.safeAreaInsets.top, left: 0,
              //                                                bottom: labelHeight, right: 0)
              //
              //            UIView.animate(withDuration: 0.25) {
              //                self.pinImageVerticalConstraint.constant = ((labelHeight - self.view.safeAreaInsets.top) * 0.5)
              //                self.view.layoutIfNeeded()
              //            }
          }
  
      }
  
  
      @IBAction func getLocationAddress(_ sender: Any) {
  //        reverseGeocodeCoordinate(target)
  
      }
  }
  
  extension DetailsViewController: UITextFieldDelegate {
      func textFieldShouldReturn(_ textField: UITextField) -&gt; Bool {
          textField.resignFirstResponder()
          return true
      }
  
      func hideKeyboardWhenTapped () {
          let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(DetailsViewController.dismissKeyboard))
          tap.cancelsTouchesInView = false
          view.addGestureRecognizer(tap)
      }
  
      func dismissKeyboard() {
          view.endEditing(true)
      }
  }
  
  extension DetailsViewController: GMSMapViewDelegate {
      func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
  //        reverseGeocodeCoordinate(position.target)
      }
  
  //    func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
  //        geoAddressLabel.lock()
  //        
  //        if (gesture) {
  //            mapCenterPinImage.fadeIn(0.25)
  //            mapView.selectedMarker = nil
  //        }
  //    }
  
  }
  </code></pre>
  
  <p>my listtableviewcontroller file:</p>
  
  <pre><code>class ListTableViewController: UITableViewController {
  
      @IBOutlet weak var listImage: UIImageView!
      @IBOutlet weak var listTitle: UILabel!
      @IBOutlet weak var listNotes: UITextView!
      @IBOutlet weak var listDate: UILabel!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Uncomment the following line to preserve selection between presentations
          // self.clearsSelectionOnViewWillAppear = false
  
          // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
          // self.navigationItem.rightBarButtonItem = self.editButtonItem()
      }
  
  
  
      override func numberOfSections(in tableView: UITableView) -&gt; Int {
          // #warning Incomplete implementation, return the number of sections
          return 0
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          // #warning Incomplete implementation, return the number of rows
          return 0
      }
  </code></pre>