Imagine this, you have a class and enum like:

and you want to sort users by their status, but users with error first. How to do that? Continue reading

Probably you saw many JSON parsing examples, but this one is really easy. And available out of the box with Swift 4.
All you have to do is create models from Codable superclass, and use:

Check out provided playground here!

Output in console should be:

As you probably notices, simple screen drawing is useless if it comes to OpenGL view. So is it possible to generate UIImage from such? Of course, lets suppose your custom drawing class extends UIView, then just add:

This code works in XCode 9 and Swift 3.x.