Definition of a cross heir - Silver Challenge Questions


I’m in the middle of doing the silver challenge in chapter 6 but it’s struck me that a definition of what a cross heir is can be different to different people. Was there anything specific variation in mind?

my idea would be a vertical and horizontal line, the cross, with a circle that intersects half way from the centre on each of the four lines. Hopefully that will cover what I’m supposed to learn from this exercise.

On a more normal question topic, I’ve found a use for saving and restoring the graphics context before the text is written to avoid having to reset the shadow options. Would you use it for anything else? Am I right in thinking that if you were to do a lot of custom drawing you’d set up different contexts depending on what you needed, rather than using the same one and altering it each time?

Thank you.


I interpreted the crosshair as just the cross itself, no circle.

And while I have no experience with graphics programming other than what we’ve done up to this silver challenge, it’s not clear that you typically create new contexts from scratch. Per the system guide Graphics and Drawing in iOS the UIView class creates a context for drawing to the screen; any other contexts would be for creating image files or PDFs.

So, pushing/popping saved contexts off the stack would presumably be the standard way of doing things. Any of the functions that start with CGContextSet presumably are easier to undo if you use the save/restore methods, especially since that relieves the burden of tweaking the inverse code for all the changes you make, each time you tweak something.

Of course, I know diddly/squat about this stuff, so I could be way off.