title: Save dictionary to UserDefaults
body: <p>I'm trying to store a dictionary in UserDefaults and always get app crash when the code runs. Here is the sample code which crashes the app when it is executed. I tried to cast it as NSDictionary or make it NSDictionary initially - got the same result.</p>
  
  <pre><code>class CourseVC: UIViewController {
  
  let test = [1:"me"]
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      defaults.set(test, forKey: "dict1")
  
      }
  
  }
  </code></pre>