Based on the spriteKit example from prag pub's book Build iOS games with SpriteKit. I ported it over to swift