Configuring the Die Views

Your goal here is to have the configuration settings that the user specifies in the sheet be reflected in the die view. To do that, DieView needs to expose properties which can be configured.

Open DieView.swift. First, add the properties which users of the class can configure:

 ​ ​ ​ ​v​a​r​ ​h​i​g​h​l​i​g​h​t​F​o​r​D​r​a​g​g​i​n​g​:​ ​B​o​o​l​ ​=​ ​f​a​l​s​e​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​d​i​d​S​e​t​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​n​e​e​d​s​D​i​s​p​l​a​y​ ​=​ ​t​r​u​e​
 ​ ​ ​ ​ ​ ​ ​ ​}​
 ​ ​ ​ ​}​

 ​ ​ ​ ​v​a​r​ ​c​o​l​o​r​:​ ​N​S​C​o​l​o​r​ ​=​ ​N​S​C​o​l​o​r​.​w​h​i​t​e​C​o​l​o​r​(​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​d​i​d​S​e​t​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​n​e​e​d​s​D​i​s​p​l​a​y​ ​=​ ​t​r​u​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.