Giter Site home page Giter Site logo

heartshare / activityindicatorview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from exyte/activityindicatorview

0.0 0.0 0.0 3.82 MB

A number of preset loading indicators created with SwiftUI

License: MIT License

Ruby 4.68% Objective-C 2.62% Swift 92.70%

activityindicatorview's Introduction

ActivityIndicatorView

A number of preset loading indicators created with SwiftUI


We are a development agency building phenomenal apps.




Travis CI Version Carthage Compatible License Platform Twitter

Usage

Create an indicator like this:

ActivityIndicatorView(isVisible: $showLoadingIndicator, type: .default)

where
showLoadingIndicator - bool value you may change to display or hide the indicator
type - value from ActivityIndicatorView.IndicatorType enum

You may alter it with standard SwiftUI means like this:

ActivityIndicatorView(isVisible: $showLoadingIndicator, type: .default)
     .frame(width: 50.0, height: 50.0)
     .foregroundColor(.red)

Or specify another indicator type:

ActivityIndicatorView(isVisible: $showLoadingIndicator, type: .growingArc(.red, lineWidth: 4))
    .frame(width: 50.0, height: 50.0)

Indicator types

Each indicator type has a number of parameters that have reasonable defaults. You can change them as you see fit, but it is advised to not set them too high or too low.

default - iOS UIActivityIndicator style

.default(count: 8)

arcs

.arcs(count: 3, lineWidth: 2)

rotatingDots

.rotatingDots(count: 5)

flickeringDots

.flickeringDots(count: 8)

scalingDots

.scalingDots(count: 3, inset: 2)

opacityDots

.opacityDots(count: 3, inset: 4)

equalizer

.equalizer(count: 5)

growingArc - add custom color for growing Arc, the default value is Color.black

.growingArc(.red, lineWidth: 4))

growingCircle no parameters
gradient - circle with angular gradient border stroke, pass colors ilke this:

.gradient([.white, .red], lineWidth: 4)

Examples

To try out the ActivityIndicatorView examples:

  • Clone the repo git clone [email protected]:exyte/ActivityIndicatorView.git
  • Open terminal and run cd <ActivityIndicatorViewRepo>/Example
  • Run pod install to install all dependencies
  • Run xed . to open project in the Xcode
  • Try it!

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/exyte/ActivityIndicatorView.git")
]

CocoaPods

pod 'ActivityIndicatorView'

Carthage

github "Exyte/ActivityIndicatorView"

Requirements

  • iOS 13+ / watchOS 6+ / tvOS 13+ / macOS 10.15+
  • Xcode 11+

Our other open source SwiftUI libraries

PopupView - Toasts and popups library
Grid - The most powerful Grid container
ScalingHeaderScrollView - A scroll view with a sticky header which shrinks as you scroll
AnimatedTabBar - A tabbar with number of preset animations
MediaPicker - Customizable media picker
ConcentricOnboarding - Animated onboarding flow
FloatingButton - Floating button menu
ProgressIndicatorView - A number of animated progress indicators
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation

activityindicatorview's People

Contributors

f3dm76 avatar jpsison-io avatar mnndnl avatar shipinev avatar waterskier2007 avatar zooxop 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.