Property wrapper for validating email using NSDataDetector

Property wrappers allow property declaration to state what kind of property wrapper is used for implementing the property. We can use it for implementing transformations on properties like validating if string is email or not. This is what we will do: creating a property wrapper for email properties and validating emails using NSDataDetector. If value …

Drawing gradients in SpriteKit

I was working on an upcoming game in SpriteKit only to discover that adding a simple gradient is not so straight-forward as one would expect. Therefore I created an extension to SKTexture. https://gist.github.com/laevandus/c38a8b9e958ef68c6730025f6b4cc7f4 This extension adds support for creating linear and radial gradients. Linear gradient can be drawn with an angle (in radians) although in …