How to add music and sounds to an iOS or macOS game with AVFoundation
While working on adding music and sounds to my latest project I found a problem: If you’re running some background music and then you trigger a sound ( for example by picking up some item ) the music will stop, as you’re overriding the sound with the new object. In order to fix this we […]
Mobile game dev: How to fix Pixel Art for iOS games
A common problem when working with Pixel Art for your games adapting your graphics for different screen sizes. Here’s how to fix Pixel Art for iOS games.
Swift initializers: init, convenience init, required init
Swift Object Oriented Programming has some niceties and differences compared to other languages. This is a quick look to init, convenience init, and required init.
Swift code reviews: Lazy variables
We use the Lazy keyword when we do not want to initialize an object or some of its properties right away, but we put off the work until we need it (The so-called JIT, or Just-In-Time mechanism).
Swift code reviews: Private setters
During a code review, I learned that I was using patterns that are not really used in Swift. How to work with public getters and private setters in Swift.