I've been working on a new iOS app which is a chess game and I needed a way to draw a chess board of various sizes. In this brief post I discuss how I use Core Graphics to draw the game board at a given size.
So you might ask why I'd bother drawing the board in Core Graphics instead of just including a nice bitmap image for either the whole board or for individual squares that could be repeated. I've listed the main reasons below
The code below is pretty self-explanatory I think, but you can check it out on GitHub and clone the repo or suggest improvements to my efforts
Here is a screenshot of the board including the chess pieces placed on it. You can see the nice gradient effect