Giter Club home page Giter Club logo

activityindicatorview's Introduction

     

ActivityIndicatorView

A number of preset loading indicators created with SwiftUI

SPM Compatible Cocoapods Compatible Carthage Compatible License: MIT

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 like 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 a number of preset animations
MediaPicker - Customizable media picker
Chat - Chat UI framework with fully customizable message cells, input view, and a built-in media picker
OpenAI Wrapper lib for OpenAI REST API
AnimatedGradient - Animated linear gradient
ConcentricOnboarding - Animated onboarding flow
FloatingButton - Floating button menu
ProgressIndicatorView - A number of animated progress indicators
FlagAndCountryCode - Phone codes and flags for every country
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation

activityindicatorview's People

Contributors

f3dm76 avatar jpsison-io avatar mnndnl avatar shipinev avatar waterskier2007 avatar zapletnev avatar zooxop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activityindicatorview's Issues

Incompatible with NavigationView

If I put ActivityIndicatorView inside NavigationView,
it would have strange behavior,
repeatedly move from top left to center.

NavigationView {
    ActivityIndicatorView(isVisible: .constant(true), type: .arcs)
        .frame(width: 70, height: 70, alignment: .center)
}

output

Some animations not animating

I ran the sample project, but not all the animations are working like in your demo animation:
Apr-25-2020 21-55-22

I did a pod install in the Example directory and ran the project... but as you can see, not everything is animating.

More rounded

Is it possible to make it more rounded here ?
image

Error

Xcode Version 12.0 (12A7209)
image

Build failure in Xcode 12

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

image

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.