Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to JSONDecoder from JSONSerialization #46

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

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