Andriy Kharchyshyn continues Part 1 of a running tutorial on using Metal for game development in Swift. In part 2, Andriy shows you how to refactor and structure your Metal code properly. He also explains some key concepts for 3D programming and how they apply in Metal: transformations, matrices and matrix operations, shaders and backface culling.
As Laurent Etiemble says, "Verifying receipts is a mechanism that helps you to protect your revenue and enforce your business model directly in your application." Well put. Laurent offers an in-depth analysis of iOS and OS X receipts: formats, data structures and much more. One of the reasons there's no standard API for verifying receipts built-in to the OS is that it would be easy for hackers to target that single API and replace it on jailbroken phones, allowing users to fake purchase receipts and download your hard-work (in-app purchases) for free. Laurent advocates writing your own receipt validation code instead of using a GitHub or similar repo version for security reasons. He shows you how to implement your own receipt validation and what types of security attacks you need to guard against. Since we're all interested in protecting our revenue streams, this is a must read.
Since you use ViewControllers in both game and non-game apps, deciding how to route your user from one ViewController to another is an important architectural decision for your code. For example, should GameViewController know about HighScoreViewController and push it directly onto the navigation stack when needed? Or should you use a global router class that pushes ViewControllers based on urls like "/highscores" or "/help/contact_us"? Alberto De Bortoli explains a different concept he calls Flow Controllers. I've started using them in both my game and non-game apps and I think they're a pretty good way to structure navigation in your apps.
Space Invaders was a classic game in the 70s and 80s. I personally sank many a quarter into its arcade version. This two-part tutorial (part 2) shows you how to make Space Invaders in Swift. It also reviews how you can cleanly structure even simple games. In the interest of full disclosure, I wrote the original version of this tutorial in Objective C (part 1, part 2). Riccardo D'Antoni was kind enough to update the original for Swift. Thanks Ricardo. 👍