Graphics Reference
In-Depth Information
Figure 4.16 A simple “pixel font” sprite sheet for displaying LCD-style digits
We'll arrange six views in Interface Builder, two each for the hours, minutes, and seconds
digits. Figure 4.17 shows how the views are arranged in Interface Builder. That many views
starts to get a bit unwieldy when using individual outlets, so we'll connect them to the
controller using an IBOutletCollection , which allows us to access the views as an
array. Listing 4.6 shows the code for the clock.
Figure 4.17 The clock digit views arranged into hours, minutes, and seconds
Listing 4.6 Displaying an LCD-Style Clock
@interface ViewController ()
@property ( nonatomic, strong ) IBOutletCollection ( UIView ) NSArray *digitViews;
@property ( nonatomic , weak ) NSTimer *timer;
Search WWH ::




Custom Search