title: How to present a dictionary in a set method swift?
body: <p>I'm trying to do a set and get method to this Data manager class, from a dictionary and I don't know how to insert the values of the dictionary' in the set and get method (i have changed it from an array to Dic) thanks  </p>
  
  <pre><code>class DataManager {
  
      private static var sharedInstance: DataManager?
      private var recordsArray: [[String:String]] = []
  
      private let defaults = UserDefaults.standard
  
      let userRecord: String = "userRecord";
  
      private init(){}
  
      public static func getInstance()-&gt; DataManager{
          if DataManager.sharedInstance == nil {
              DataManager.sharedInstance = DataManager()
          }
          return DataManager.sharedInstance!
      }
  
  
      //here is my problem - set and get methods
      //I don't know how to move the parameters
  
      public func setRecordsArray([_:String,path:String])  {
          self.recordsArray.append(?);
          defaults.set(self.recordsArray, forKey: self.userRecord)
      }
      // again the same problem
  
      public func getRecordsArray() -&gt; [String] {
          let a = self.defaults.array(forKey: self.userRecord);
          return a as! [String];    
      }
  }
  </code></pre>