sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.85k stars 366 forks source link

NSCoding support for non-final classes #163

Closed mlilback closed 5 years ago

mlilback commented 6 years ago

With 3.0, I handle (NS)FontDescriptor as a custom type. WIth 4.0, I can't get it to work as a custom type or via DefaultsSerializable (extension FontDescriptor: DefaultsSerializable {}) without the error:

protocol 'DefaultsGettable' requirement 'getArray(key:userDefaults:)' cannot be satisfied 
by a non-final class ('NSFontDescriptor') because it uses 'Self' in a non-parameter, 
non-result type position`

Is there a way to store non-final, Apple-supplied classes?