Latest 1.0.0
Homepage https://github.com/jonathantribouharet/JTBorderDotAnimation
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Version
License
Platform

JTBorderDotAnimation is a simple animation for have dots turning around a UIView on iOS.

Installation

With CocoaPods, add this line to your Podfile.

pod 'JTBorderDotAnimation', '~> 1.0'

Screenshots

Example

Usage

Basic usage

Just import JTBorderDotAnimation.h.

#import "JTBorderDotAnimation.h"

@interface ViewController : UIViewController

@property (weak, nonatomic) IBOutlet UIView *animatedView;

@property (strong, nonatomic) JTBorderDotAnimation *dotAnimation;

@end

Assign the view you want to animate and start the animation.

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.dotAnimation = [JTBorderDotAnimation new];
    self.dotAnimation.animatedView = self.animatedView;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    [self.dotAnimation start];
}

Customization

You can easily customize the animation.

  • numberPoints
  • duration
  • repeatCount
  • pointSize
  • pointColor

Example:

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.dotAnimation = [JTBorderDotAnimation new];
    self.dotAnimation.animatedView = self.animatedView;

    self.dotAnimation.numberPoints = 6;
    self.dotAnimation.duration = 6.;
    self.dotAnimation.repeatCount = 3;
    self.dotAnimation.pointSize = 5.;
    self.dotAnimation.pointColor = [UIColor orangeColor];
}

Notes

clipsToBounds property of the animatedView is set to NO at the beginning of the animation.

You can also change the speed of the animation without stopping it with:

    CALayer *layer = self.animatedView.layer;

    layer.timeOffset = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
    layer.beginTime = CACurrentMediaTime();
    layer.speed = 2.;

Requirements

  • iOS 7 or higher
  • Automatic Reference Counting (ARC)

Known Issues

  • Animation stop when the application go in background, you have to restart it manually

Author

License

JTBorderDotAnimation is released under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JTBorderDotAnimation",
    "version": "1.0.0",
    "summary": "A simple animation with dots turning around a UIView for iOS",
    "homepage": "https://github.com/jonathantribouharet/JTBorderDotAnimation",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Jonathan Tribouharet": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/jonathantribouharet/JTBorderDotAnimation.git",
        "tag": "1.0.0"
    },
    "source_files": "JTBorderDotAnimation/*",
    "requires_arc": true,
    "screenshots": [
        "https://raw.githubusercontent.com/jonathantribouharet/JTBorderDotAnimation/master/Screens/example.gif"
    ]
}

Pin It on Pinterest

Share This