• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    Objective-C
  • License
    Other
  • Created about 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A replacement class for `NSProgressIndicator` driven by Core Animation

ITProgressIndicator

A replacement class for NSProgressIndicator driven by Core Animation. It's highly customisable and much more efficient than NSProgressIndicator.

ITProgressInidicator was created for Play by Play, development funded by David Keegan.

Usage

Copy files

Copy the following files:

  • ITProgressIndicator.h
  • ITProgressIndicator.m

Make sure to copy them to the project, and to add them to the target.

Use in a project

Make sure to check out the sample project. Simply drag a custom view onto your window and set it's custom class to ITProgressIndicator.

It's advised to embed your progress indicator into a layer-backed view! Look at the demo application for clarifaction.

To customise your progress indicator, use the following properties:

/// @property isIndeterminate - Indicates if the view will show the progress, or just spin
@property (nonatomic, setter = setIndeterminate:) BOOL isIndeterminate;

/// @property progress - The amount that should be shown when `isIndeterminate` is set to `YES`
@property (nonatomic) CGFloat progress;

/// @property animates - Indicates if the view is animating
@property (nonatomic) BOOL animates;

/// @property hideWhenStopped - Indicates if the view will be hidden if it's stopped
@property (nonatomic) BOOL hideWhenStopped;

/// @property lengthOfLine - The length of a single line
@property (nonatomic) CGFloat lengthOfLine;

/// @property widthOfLine - The width of a single line
@property (nonatomic) CGFloat widthOfLine;

/// @property numberOfLines - The number of lines of the indicator
@property (nonatomic) NSUInteger numberOfLines;

/// @property innerMargin - The distance of the lines from the middle
@property (nonatomic) CGFloat innerMargin;

/// @property animationDuration - Duration of a single rotation
@property (nonatomic) CGFloat animationDuration;

/// @property gradualAnimation - Defines if the animation is smooth or gradual
@property (nonatomic) BOOL steppedAnimation;

/// @property color - The color of the progress indicator
@property (nonatomic, strong) NSColor *color;

You can also override the following method to achieve your own custom animation:

/**
 *  Override this method to achieve a custom animation
 *
 *  @return CAKeyframeAnimation - animation which will be put on the progress indicator layer
 */
- (CAKeyframeAnimation *)keyFrameAnimationForCurrentPreferences;

More Repositories

1

ITSwitch

ITSwitch is a replica of UISwitch for Mac OS X
Objective-C
290
star
2

ITSidebar

ITSidebar is a control for Mac OS X similar to the one of Sparrow
Objective-C
267
star
3

Pathfinder

A pathfinding library written in Swift
Swift
153
star
4

Pathbar

ITPathbar is a NSPathControl subclass, with a custom design.
Objective-C
130
star
5

ITPullToRefreshScrollView

ITPullToRefreshScrollView is a subclass of `NSScrollView` with iOS 7 style refreshing
Objective-C
103
star
6

ITProgressBar

ITProgressBar is a very lightweight progress bar replacement for Mac OS X
Objective-C
81
star
7

ITProgressBar-iOS

ITProgressBar is a simple iOS 7 style progress bar control.
Objective-C
46
star
8

ITSearchField

ITSearchField is a subclass of NSSearchField, which can collapse and expand if you click the search icon.
Objective-C
39
star
9

Conway-s-Game-of-Life

Conway's Game of Life written in Swift
Swift
36
star
10

ITNavigationView

A iOS like view driven by Core Animation, that can replace it's subview with a sleek animation
Objective-C
32
star
11

ITActivityIndicator

A very simple alternative to UIActivityIndicatorView
Swift
21
star
12

ITTransitionView

A port of ADTransitionController to Mac OS X
Objective-C
14
star
13

ITShortcutReader

Objective-C
9
star
14

2048

A clone of 2048 written with Cocos2d in Swift
Objective-C
6
star
15

Super-Mario-Bros

A super buggy version of Super Mario Bros. for iOS
Objective-C
5
star
16

Tetris

A simple Tetris game written in Swift
Swift
5
star
17

ViewControllerTest

Small NSViewController test for a question on Stackoverflow
Objective-C
4
star
18

zmk-config

Makefile
1
star
19

php-typealias-rfc

1
star
20

php-benchmark-data

1
star