Skip to content

Conversation

@BritneyS
Copy link

What you did ❓

  • Updated parse method: uses JSONDecoder instead of JSONSerialization

How you did it ✅

  • Made model classes (LaunchGateConfiguration, UpdateConfiguration, and AlertConfiguration) conform to Decodable
  • Manually decoded the LaunchGateConfiguration and UpdateConfiguration classes with decoder initializers
  • Rewrote parse method to use JSONDecoder in order to parse the root object (LaunchGateConfiguration type) and its nested objects (UpdateConfiguration and AlertConfiguration)
  • Removed error enum, since Decodable classes will throw the appropriate errors

How to test it 🔬

  • Build and run the Example app
  • An alert should pop up that reads "An update is required to continue using this app."

Screenshots (if applicable) 📷

simulator screen shot - iphone xr - 2018-11-16 at 09 35 01

…ers used in DialogType enum associated values
…r all three objects to be represented in JSON
…emoved manual error handling (Decodable throws the appropriate errors)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant