Drawing Text Die Faces

Open DieView.swift and jump to drawDieWithSize(_:). Add the following code below the block that draws the die dots. The new code will run if intValue is not in the range 1...6.

 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​i​f​ ​i​n​t​V​a​l​u​e​ ​=​=​ ​6​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​d​r​a​w​D​o​t​(​0​,​ ​0​.​5​)​ ​/​/​ ​M​i​d​ ​l​e​f​t​/​r​i​g​h​t​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​d​r​a​w​D​o​t​(​1​,​ ​0​.​5​)​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​}​
 ​ ​ ​ ​ ​ ​ ​ ​}​
 ​ ​ ​ ​ ​ ​ ​ ​e​l​s​e​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​v​a​r​ ​p​a​r​a​S​t​y​l​e​ ​=​ ​N​S​P​a​r​a​g​r​a​p​h​S​t​y​l​e​.​d​e​f​a​u​l​t​P​a​r​a​g​r​a​p​h​S​t​y​l​e​(​)​.​m​u​t​a​b​l​e​C​o​p​y​(​)​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​a​s​!​ ​N​S​M​u​t​a​b​l​e​P​a​r​a​g​r​a​p​h​S​t​y​l​e ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.