github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

kelan / yrk-spinning-progress-indicator-layer

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 5
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A clone of the spinning NSProgressIndicator, written using Core Animation — Read more

  cancel

yrk-spinning-progress-indicator-layer

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Converted README to markdown and cleaned it up a bit. 
kelan (author)
Sun Dec 20 19:43:05 -0800 2009
commit  882e5f27f3210450c58a153d7a5c1566f56270ef
tree    06a1f5f58846ba95126101dcec23dcf154752cda
parent  3e91527408d5d6a4f2a437762316788a2178c4c2
yrk-spinning-progress-indicator-layer /
name age
history
message
file .gitignore Sun Dec 20 19:08:50 -0800 2009 Added gitignore file [kelan]
directory Code/ Sun Dec 20 19:14:40 -0800 2009 Fix typo of class name * good catch by riqueda... [kelan]
file README.mdown Mon Dec 21 01:15:16 -0800 2009 Converted README to markdown and cleaned it up ... [kelan]
directory Resources/ Sat Feb 14 21:04:51 -0800 2009 Initial commit [kelan]
directory SPILDemo.xcodeproj/ Tue Jun 02 21:36:30 -0700 2009 Implement fix from Eric Roccasecca (via email) ... [kelan]
file SPILDemo_Prefix.pch Sat Feb 14 21:04:51 -0800 2009 Initial commit [kelan]
file notes.txt Sat Feb 14 21:04:51 -0800 2009 Initial commit [kelan]
README.mdown

YRKSpinningProgressIndicatorLayer and SPILDemo.app

Kelan Champagne (http://yeahrightkeller.com)

Please feel free to send me questions or comments.

Version History

  • v1.0 2008-07-08 Initial Release.
  • v1.1 2009-02-14 Fixes from Eric Roccasecca.

Overview

YRKSpinningProgressIndicatorLayer is a clone of the NSProgressIndicator (spinning-style) that can be set to an arbitrary size and color, and used with CoreAnimation layers.

Features

  • Implemented as a subclass of CALayer.
    • Can be used with and overlaid on other CALayers.
  • Can be set to arbitrary size and color.
    • Can even be changed while animating.
  • Upon starting animation, each "fin" appears only when it is first drawn.
  • When animating, each fin fades from opaque to transparent.
    • As they fade, you can see through the fins to the background.
  • When stopped, no new fins are drawn, and the existing fins fade to transparent,

Code Architecture

  • Implemented as a subclass of CALayer.
    • Each fin is a sub-layer made of a generic CALayer and drawn by setting the bounds, corner radius, and background color.
  • Animation is done with an NSTimer.

Notes/Limitations

  • If resized really fast, some fins will not be drawn.
  • When drawn a large size (i.e. full-screen), the animation can take up a pretty good chunk of CPU. But, at smaller sizes, it's not bad. The good news is that since it's Leopard-only, it won't be running on anything slower than 800mhz/512MB ram. I tested it on my PPC revA Mac Mini that is 1.25Ghz/512MB (and weak graphics), and it ran OK at everything except full-screen. The QC composition in the background of the demo app was a much bigger culprit though, and with the solid background, it is ok. So, hopefully the performance is acceptable. If not, I have an idea for caching all the fin images, instead of having CoreAnimation do all the drawing on the fly. But, the way it is now makes for really clean code, so I left it like that for now. * For some reason, the Quartz Composer background (with the clouds) of the SPILDemo app doesn't animate when built in Release mode.

Code Conventions

  • Instance variables are prefixed with an underscore (i.e. "_").
  • "Private" methods are declared in a Class Continuation (i.e. name-less category) at the top of the .m file.

Contributing

Please feel free to fork this project, or email any patches to me at kelan@yeahrightkeller.com.

License (BSD)

Copyright (c) 2009, Kelan Champagne (http://yeahrightkeller.com)

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Kelan Champagne nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Also, I'd appreciate it if you would let me know if you find this code useful.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server