Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Polyrhythm-Inc/KRActivityIndicatorView

Repository files navigation

日本語

KRActivityIndicatorView

Version License Platform Download Carthage compatible CI Status

KRActivityIndicatorView is a simple and customizable activity indicator written in Swift.

You can add KRActivityIndicatorView from IB and code.

On HUD => https://github.com/krimpedance/KRProgressHUD

Features

  • Round indicator
  • Indicator color can be customized

Requirements

  • iOS 10.0+
  • Xcode 9.0+
  • Swift 4.0+

DEMO

To run the example project, clone the repo, and open KRActivityIndicatorViewDemo.xcodeproj from the DEMO directory.

or appetize.io

Installation

KRActivityIndicatorView is available through CocoaPods and Carthage. To install it, simply add the following line to your Podfile or Cartfile:

# CocoaPods
pod "KRActivityIndicatorView"
# Carthage
github "Krimpedance/KRActivityIndicatorView"

Usage

(see sample Xcode project in /Demo)

Usage is almost same as UIActivityIndicatorView.

Showing activity indicator

Show simple KRActivityIndicatorView.

let activityIndicator = KRActivityIndicatorView()
view.addSubview(activityIndicator)

With single color.

KRActivityIndicatorView(style: .color(.green))

With gradation color.

KRActivityIndicatorView(style: .gradationColor(head: .red, tail: .orange))

Start and stop animation.

activityIndicator.startAnimating()
activityIndicator.stopAnimating()

Customization

KRActivityIndicatorViewStyle

  • color(color) - The fill color of activity indicator is set to color.
  • color(head: UIColor, tail: UIColor) - The fill color of activity indicator is gradated from head color to tail color.

Current available params on IB:

  • headColor - gradient head color.
  • tailColor - gradient tail color.
  • isLarge - Size of KRActivityIndicatorView. Default(off) size is 20x20, Large size is 50x50.
  • animating - Animation of activity indicator when it's shown
  • hidesWhenStopped - calls setHidden when call stopAnimating()

Contributing to this project

I'm seeking bug reports and feature requests.

Release Note

  • 2.1.0 : Available at CocoaPods and Carthage with Xcode9 and Swift4.
  • 2.0.2 : Fixed bag which don't change headColor and 'tailColor'.

License

KRActivityIndicatorView is available under the MIT license. See the LICENSE file for more info.

About

A simple and customizable activity indicator.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 92.2%
  • Ruby 4.3%
  • Objective-C 3.5%

AltStyle によって変換されたページ (->オリジナル) /