title: How to save an array of custom struct to NSUserDefault with swift?
body: <p>I have an custom struct called 'News' that I want to append into the array to NSUserDefault. But it's showing error "Type 'News' does not conform to protocol 'AnyObject'".</p>
  
  <p>I don't want to change the 'News' struct to a class since it's being used for other code already. Is there anyway that I can change NSUserDefaults.standardUserDefaults().arrayForKey("savedNewsArray") type to [News]?</p>
  
  <pre><code>var savedNews = NSUserDefaults.standardUserDefaults().arrayForKey("savedNewsArray")
  var addSavedNews = savedNews as? [News]
  addSavedNews.append(News(id: "00", title: newsTitle, source: source, imageURL: imageURL, url: url))
  NSUserDefaults.standardUserDefaults().setObject(addSavedNews, forKey: "savedNewsArray")
  NSUserDefaults.standardUserDefaults().synchronize()
  </code></pre>
  
  <p>Here is the 'News' struct.</p>
  
  <pre><code>public struct News {
      public var id: String
      public var title: String
      public var source: String?
      public var imageURL: String?
      public var date: NSDate?
      public var url: String
  
      init(id: String, title: String, source: String, imageURL: String, url: String) {
          self.id = id
          self.title = title
          self.source = source
          self.imageURL = imageURL
          self.url = url
      }
  }
  </code></pre>