Skip to content

Instantly share code, notes, and snippets.

@randomguy0815
Last active March 27, 2019 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomguy0815/93d153dc5b6793658f851f0f3f9ce152 to your computer and use it in GitHub Desktop.
Save randomguy0815/93d153dc5b6793658f851f0f3f9ce152 to your computer and use it in GitHub Desktop.
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: Keys.self)
   
self.status = try? Container.decodeIfPresent(Status.self, forKey: .status) ?? .disabled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment