Giter Site home page Giter Site logo

lerist / kractivityindicatorview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from henryforce/kractivityindicatorview

0.0 2.0 0.0 2.32 MB

An activity indicator view for OSX written in Swift!

License: MIT License

Swift 98.94% Objective-C 1.06%

kractivityindicatorview's Introduction

KRActivityIndicatorView

Carthage Compatible MIT licensed

Introduction

KRActivityIndicatorView is a collection of awesome loading animations for OSX apps written in Swift 3.0.

This is a fork from NVActivityIndicatorView, which is made for iOS. Amazing code made by Vinh Nguyen!

The original code for the NVActivityIndicatorView is not 100% compatible with OSX. And the project has some amazing loaders, so I decided to port the code in order for it to work in OSX. Fortunately, KRActivityIndicatorView maintains most of the functionality and all the animations of the iOS counterpart.

Demo

alt tag

Animation types

Type Type Type Type
  1. BallPulse | 2. BallGridPulse | 3. BallClipRotate | 4. SquareSpin
  2. BallClipRotatePulse | 6. BallClipRotateMultiple | 7. BallPulseRise | 8. BallRotate
  3. CubeTransition | 10. BallZigZag | 11. BallZigZagDeflect | 12. BallTrianglePath
  4. BallScale | 14. LineScale | 15. LineScaleParty | 16. BallScaleMultiple
  5. BallPulseSync | 18. BallBeat | 19. LineScalePulseOut | 20. LineScalePulseOutRapid
  6. BallScaleRipple | 22. BallScaleRippleMultiple | 23. BallSpinFadeLoader | 24. LineSpinFadeLoader
  7. TriangleSkewSpin | 26. Pacman | 27. BallGridBeat | 28. SemiCircleSpin
  8. BallRotateChase | 30. Orbit | 31. AudioEqualizer

Installation

Carthage

Install Carthage if need be.

$ brew update
$ brew install carthage

Add KRActivityIndicatorView in your Cartfile.

github "henryforce/KRActivityIndicatorView"

Run carthage to build the framework and drag the built KRActivityIndicatorView.framework into your Xcode project.

Manual

Copy KRActivityIndicatorView folder to your project. That's it.

Note: Make sure that all files in KRActivityIndicatorView are included in Compile Sources in Build Phases.

Usage

Firstly, import KRActivityIndicatorView.

import KRActivityIndicatorView

Initialization

Then, there are two ways you can create KRActivityIndicatorView:

  • By storyboard, changing class of any NSView to KRActivityIndicatorView.

Note: Set Module to KRActivityIndicatorView.

  • By code, using initializer. All parameters other than frame are optional and KRActivityIndicatorView.DEFAULT_* are used as default values.
KRActivityIndicatorView(frame: frame, type: type, color: color, padding: padding)

Control

Start animating.

activityIndicatorView.startAnimating()

Stop animating.

activityIndicatorView.stopAnimating()

Determine if it is animating.

animating = activityIndicatorView.animating

Change properties

In storyboard, you can change all properties in Attributes inspector tab of Utilities panel.

Note: Use one of values (case-insensitive) in Animation types for Type Name.

All properties are public so you can change them all after initiating.

Note: All changes must be made before calling startAnimating().

Acknowledgment

Thanks to Connor Atherton for designing the loaders and Danil Gontovnik and Vinh Nguyen for the base code.

License

The MIT License (MIT)

2017 Henry Serrano @HenrySerrano20

kractivityindicatorview's People

Contributors

henryforce avatar

Watchers

Lerist avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.