title: Custom Struct: Type does not conform to protocol 'Decodable'
body: <p>I would like to be able to save a <code>Custom-struct</code>  to <code>UserDefaults</code> but for that I need it to be <code>Codable</code>.. I tried it like this:</p>
  
  <pre><code>struct Wishlist: Codable {
  var name: String
  var image: UIImage
  var wishData: [Wish]
  var color: UIColor
  var textColor: UIColor
  var index: Int
  }
  </code></pre>
  
  <p>But that gives me this <code>error</code>:</p>
  
  <blockquote>
    <p>Type 'Wishlist' does not conform to protocol 'Decodable'</p>
  </blockquote>
  
  <p>Here is my <code>Class Wish</code> , maybe that's where the problem is:</p>
  
  <pre><code>class Wish: NSObject {
  public var wishName : String?
  public var checkedStatus : Bool?
  public var wishLink : String?
  public var wishPrice : String?
  public var wishNote : String?
  public var wishImage : UIImage?
  
  init(withWishName name: String, link: String, price: String, note: String, image: UIImage, checked: Bool) {
      super.init()
      wishName = name
      checkedStatus = checked
      wishLink = link
      wishPrice = price
      wishNote = note
      wishImage = image
  }
  }
  </code></pre>
  
  <p>What am I doing wrong here??</p>