antiguab/BALoadingView
소개
A UIView that offers several loading animations
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalBALoadingView
Overview

A UIView that offers several loading animations.
Requirements
- Works on any iOS device
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Getting Started
Installation
BALoadingView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BALoadingView"
Simple Usage
startAnimation:
To add a BALoadingView to your app, add the line:
BALoadingView *view = [[BALoadingView alloc] initWithFrame:self.view.frame];
[self.loadingView initialize];
[self.loadingView startAnimation:BACircleAnimationFullCircle];
//OR [self.loadingView startAnimation:BACircleAnimationSemiCircle];
This creates the following animation/button by default:

Passing the BACircleAnimationSemiCircle enum produces:

stopAnimation
stopAnimation removes the animations from the view.
Advanced Usage
Listed below are examples of several properties that you can control.
Initialize
initialize sets the default values and should be called before setting any properties.
Duration
If you want the loading animation to last longer/shorter, you can edit the duration property:
BALoadingView *loadingView = [[BALoadingView alloc] initWithFrame:self.view.frame];
[self.loadingView initialize];
self.loadingView.duration = 20.0f;
self.loadingView.segmentColor = [UIColor whiteColor];
[self.loadingView startAnimation:BACircleAnimationFullCircle];
This creates this view:

Clockwise
Editting the clockwise boolean property changes the direction of the full circle animation:
BALoadingView *loadingView = [[BALoadingView alloc] initWithFrame:self.view.frame];
[self.loadingView initialize];
self.loadingView.clockwise = YES;
self.loadingView.segmentColor = [UIColor whiteColor];
[self.loadingView startAnimation:BACircleAnimationFullCircle];
This creates this view:

Segment Color
the segmentColorproperty controls the color of the segments and can be used like like in the example above
Line Cap
the lineCapproperty controls the end caps for the semi circle animation. The rouded cap option is seen below:
[self.loadingView initialize];
self.loadingView.lineCap = kCALineCapRound;
self.loadingView.clockwise = true;
self.loadingView.segmentColor = [UIColor whiteColor];
[self.loadingView startAnimation:BACircleAnimationFullCircle];
The animation looks like this:

Author
Bryan Antigua, [email protected] - bryanantigua.com
License
BALoadingView is available under the MIT license. See the LICENSE file for more info.
관련 프로젝트 살펴보기
불러오는 중…