see this. https://www.bloc.io/tutorials/swiftris-build-your-first-ios-game-with-swift#!/chapters/675