Skip to content

Instantly share code, notes, and snippets.

@agiletalk
Created August 30, 2019 15:37
Show Gist options
  • Save agiletalk/08303f83946bf61132195fe62e687981 to your computer and use it in GitHub Desktop.
Save agiletalk/08303f83946bf61132195fe62e687981 to your computer and use it in GitHub Desktop.
var pagingArrayForType = try feeds.nestedUnkeyedContainer()
var pagingContainer = pagingArrayForType
while(!pagingArrayForType.isAtEnd) {
let feedItem = try pagingArrayForType.nestedContainer(keyedBy: FeedKeys.self)
let type = try feedItem.decode(FeedType.self, forKey: .type)
switch type {
case .job: // decode job item
case .company: // decode company item
case .content: // decode content item
case .event: // decode event item
case .theme: // decode theme item
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment