Giter Site home page Giter Site logo

skactivityindicatorview's Introduction

SKActivityIndicatorView

SKActivityIndicatorView is a lightweight and easy-to-use ActivityIndicator for your iOS app written in swift.

SKActivityIndicatorView

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Features

  • Four ActivityIndicator Styles
  • ActivityIndicator Customization
  • Easy & Quick Integration

Requirements

  • iOS 13.0+
  • Xcode 11+
  • Swift 5.0+

Installation

CocoaPods

To integrate SKActivityIndicatorView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
use_frameworks!

target '<Your Target Name>' do
pod 'SKActivityIndicatorView', '~> 1.0.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate SKActivityIndicatorView into your Xcode project using Carthage, specify it in your Cartfile:

github "SachK13/SKActivityIndicatorView" ~> 1.0.0

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but SKActivityIndicatorView does support its use on supported platforms.

Once you have your Swift package set up, adding SKActivityIndicatorView as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/SachK13/SKActivityIndicatorView.git", .upToNextMajor(from: “1.2.1))
]
Or Add with Branch -> master instead of version

Manual

You can directly add the SKActivityIndicatorView.swift and SKActivityIndicatorViewStyle.swift source files into your Xcode project.

Include SKActivityIndicatorView wherever you need it with import SKActivityIndicatorView.

Usage

(see sample Xcode project in /Example) To run the example project, clone the repo, and run pod install from the Example directory first.

Import the module.

import SKActivityIndicatorView

Now, you can show only ActivityIndicatorView without status message:

SKActivityIndicator.show()

Display ActivityIndicatorView with status message:

SKActivityIndicator.show("Loading...")

Display ActivityIndicatorView with status message and user interaction status:

SKActivityIndicator.show("Loading...", userInteractionStatus: true)

Hide ActivityIndicatorView:

SKActivityIndicator.dismiss()

Customization

// default is darkGray
SKActivityIndicator.spinnerColor(UIColor.darkGray)


// default is black
SKActivityIndicator.statusTextColor(UIColor.black)


// default is System Font
let myFont = UIFont(name: "AvenirNext-DemiBold", size: 18)
SKActivityIndicator.statusLabelFont(myFont!)


// ActivityIndicator Styles: choose and set one of four.
SKActivityIndicator.spinnerStyle(.defaultSpinner)
SKActivityIndicator.spinnerStyle(.spinningFadeCircle)
SKActivityIndicator.spinnerStyle(.spinningCircle)
SKActivityIndicator.spinnerStyle(.spinningHalfCircles)

License

SKActivityIndicatorView is released under the MIT license. See LICENSE for details.

skactivityindicatorview's People

Contributors

sachk13 avatar iosleep avatar armintelker avatar somuyadav avatar

Stargazers

Ahmed Taha avatar Ali Waseem avatar  avatar AppsKottage avatar Charlie avatar Aaron Lee avatar Nazır Doğan avatar  avatar Asad Ali avatar TOYAMA Yosaku avatar Utsav Patel avatar  avatar Noura avatar Igor Zubkov avatar Kyle Howells avatar Muhammad Umer avatar Oguz Parlak avatar  avatar  avatar Mariam AlJamea avatar Andrew avatar Mahmoud Kandeel avatar  avatar Elbert John A. Orozco avatar Thibaut LE LEVIER avatar Lan Qingyong avatar Amin Siddiqui avatar Thanh Pham avatar Naun Telo avatar Wayne Williams avatar  avatar lengshengren avatar  avatar Kalpesh Vala avatar Eric Schofield avatar  avatar Tim Kersey avatar David Martínez avatar duxinfeng avatar Alexandr avatar David Martínez avatar Ivan avatar  avatar Kirill Kunst avatar Manish Kumar avatar Paweł Kata avatar  avatar  avatar  avatar Amr Sameh avatar  avatar Hemang avatar Sally Ahmed avatar Jaime Fili avatar yaole avatar Toseef Khilji avatar Moonlight avatar Adeyinka Adediji avatar Narcis avatar Seho Park avatar Rathish Marthandan avatar Nihed Majdoub avatar MohsinAli avatar  avatar  avatar Carabineiro avatar

Watchers

James Cloos avatar MohsinAli avatar Carabineiro avatar  avatar

skactivityindicatorview's Issues

Did you updated cocoapods for Swift 4.2?

I tried updating to cocoapod, but looks pod version is still old.

I used pod 'SKActivityIndicatorView' without any specific version and I received SKActivityIndicatorView (0.1.0) version.

Crash on ios 13

Crash on ios 13, window!.frame

Fix :
in -> SKActivityIndicatorView.swift
Replace ↓
Old:
let delegate: UIApplicationDelegate = UIApplication.shared.delegate!
if let windowObj = delegate.window {
window = windowObj
} else {
window = UIApplication.shared.keyWindow!
}

New:
if let delegate = UIApplication.shared.delegate as? AppDelegate {
if let windowObj = delegate.window {
window = windowObj
} else {
window = UIApplication.shared.keyWindow!
}
}

Don't forget to add ↓ in AppDelegate
var window: UIWindow?

UserInteration is disabled from modal screen

If indicator is displayed from modal screen and then on modal screen dimissing indicator and dismiss modal screen, is causing userinteraction disabled always. This way app is getting blocked.

Pod installation issue

I'm facing this issue when I try to update or install pod

**[!] CocoaPods could not find compatible versions for pod "SKActivityIndicatorView":
In Podfile:
SKActivityIndicatorView (~> 1.0.0)

None of your spec sources contain a spec satisfying the dependency: SKActivityIndicatorView (~> 1.0.0).

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.**

Loader gets crashed in iOS 13

The loader gets crashed in SKActivityIndicatorView.swift, inside configureActivityIndicator(withStatusMessage:, isUserInteractionEnabled:) method.
The crash is actually happened in these lines,
if activityIndicatorView?.superview == nil && userInteractionStatus == false {
backgroundView = UIView.init(frame: window!.frame)
backgroundView!.backgroundColor = backgroundViewColor
window!.addSubview(backgroundView!)
backgroundView!.addSubview(activityIndicatorView!)
} else {
window!.addSubview(activityIndicatorView!)
}

here in the first line. and I checked the backgroundView is getting nil. Also the pod is not updated to support iOS 13. Please help.

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.