Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 109 lines (75 sloc) 4.288 kb
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
1 # YRKSpinningProgressIndicatorLayer and SPILDemo.app
2
3 Kelan Champagne (http://yeahrightkeller.com)
4
5 Please feel free to send me questions or comments.
6
7
8 ## Version History
9
10 * v1.0 2008-07-08 Initial Release.
11 * v1.1 2009-02-14 Fixes from Eric Roccasecca.
7e249df @kelan Updated readme
authored
12 * v1.2 2011-07-17 CGFloat fix from Eloy Duran, and other cleanup.
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
13
14
15 ## Overview
16
17 YRKSpinningProgressIndicatorLayer is a clone of the NSProgressIndicator
18 (spinning-style) that can be set to an arbitrary size and color, and used with
19 CoreAnimation layers.
20
21
22 ## Features
23
24 * Implemented as a subclass of CALayer.
25 * Can be used with and overlaid on other CALayers.
26 * Can be set to arbitrary size and color.
27 * Can even be changed while animating.
7e249df @kelan Updated readme
authored
28 * Has nice, subtle animation effects
29 * Upon starting animation, each "fin" appears only when it is first drawn.
30 * When animating, each fin fades from opaque to transparent.
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
31 * As they fade, you can see through the fins to the background.
7e249df @kelan Updated readme
authored
32 * When stopped, no new fins are drawn, and the existing fins fade to transparent,
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
33
34
35 ## Code Architecture
36
37 * Implemented as a subclass of CALayer.
38 * Each fin is a sub-layer made of a generic CALayer and drawn by setting the
39 bounds, corner radius, and background color.
40 * Animation is done with an NSTimer.
41
42
43 ## Notes/Limitations
44
45 * If resized really fast, some fins will not be drawn.
7e249df @kelan Updated readme
authored
46 * When drawn a large size (i.e. full-screen), the animation can take up
47 a pretty good chunk of CPU. But, at smaller sizes, it's not bad.
48 * The good news is that since it's Leopard-only, it won't be running
49 on anything slower than 800mhz/512MB ram.
50 * I tested it on my PPC revA Mac Mini that is 1.25Ghz/512MB (and
51 weak graphics), and it ran OK at everything except full-screen.
52 * The QC composition in the background of the demo app was a much
53 bigger culprit though, and with the solid background, it is ok.
54 * So, hopefully the performance is acceptable. If not, I have an
55 idea for caching all the fin images, instead of having
56 CoreAnimation do all the drawing on the fly. But, the way it is
57 now makes for really clean code, so I left it like that for now.
58 * For some reason, the Quartz Composer background (with the clouds)
59 of the SPILDemo app sometimes doesn't animate when built in Release mode.
60 But, this appears to be fixed on 10.6.
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
61
62
63 ## Code Conventions
64
65 * Instance variables are prefixed with an underscore (i.e. "_").
7e249df @kelan Updated readme
authored
66 * "Private" methods are declared in a Class Continuation (i.e. name-less
67 category) at the top of the .m file.
882e5f2 @kelan Converted README to markdown and cleaned it up a bit.
authored
68
69
70 ## Contributing
71
72 Please feel free to fork this project, or email any patches to me at
73 kelan@yeahrightkeller.com.
74
75
76 # License (BSD)
77
78 Copyright (c) 2009, Kelan Champagne (http://yeahrightkeller.com)
79
80 All rights reserved.
81
82 Redistribution and use in source and binary forms, with or without
83 modification, are permitted provided that the following conditions are met:
84
85 * Redistributions of source code must retain the above copyright
86 notice, this list of conditions and the following disclaimer.
87 * Redistributions in binary form must reproduce the above copyright
88 notice, this list of conditions and the following disclaimer in the
89 documentation and/or other materials provided with the distribution.
90 * Neither the name of the Kelan Champagne nor the
91 names of its contributors may be used to endorse or promote products
92 derived from this software without specific prior written permission.
93
94 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
95 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
96 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
97 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
98 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
99 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
100 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
101 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
102 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
103 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
104 POSSIBILITY OF SUCH DAMAGE.
105
106
107 Also, I'd appreciate it if you would let me know if you find this code useful.
108
Something went wrong with that request. Please try again.