June 2011
Intermediate to advanced
590 pages
19h 31m
English
Now that you have some experience with Objective-C and the iOS SDK, how would you add the colorize-on-shake and invert-color-on-rotate features? You would probably write a method that would loop over every line, perform some calculations with that line’s data, and then set its color.
// A candidate for colorizeOnShake as implemented by TouchDrawView - (void)colorizeOnShake { for(Line *l in completeLines) { UIColor *clr = [self computeColorForLine:l]; [l setColor:clr]; } [self setNeedsDisplay]; ...Read now
Unlock full access