:hatching_chick: Lightweight Swift loading activity for iOS7+

Overview

EZLoadingActivity

CocoaPods Compatible Carthage compatible

Lightweight Swift loading activity for iOS7+. Really simple to use, just add the class and write 1 line of code.

demo

Easy to use:

EZLoadingActivity.show("Loading...", disableUI: true)

'disableUI' stops user interactions until you hide loadingactivity.

How to dismiss:

EZLoadingActivity.hide(success: true, animated: true)

Failure:

EZLoadingActivity.hide(success: false, animated: true)

demo

Without Animation:

EZLoadingActivity.hide(success: true, animated: false)

demo

Hide Directly:

EZLoadingActivity.hide()

demo

Editing:

EZLoadingActivity.Settings.SuccessColor = UIColor.blueColor()
EZLoadingActivity.show("Loading...", disableUI: false)
Settings Options
BackgroundColor
ActivityColor
TextColor
FontName
SuccessIcon
FailIcon
SuccessText
FailText
SuccessColor
FailColor
ActivityWidth
ActivityHeight

Example Use Case:

EZLoadingActivity.show("Uploading...", disableUI: false)

var postObject = PFObject(className: "className")
postObject.saveInBackgroundWithBlock { (succeeded: Bool, error: NSError!) -> Void in
    if error == nil {
       if succeeded == true {
          EZLoadingActivity.hide(success: true, animated: false)
          print("Upload Complete")
        } else {
          EZLoadingActivity.hide(success: false, animated: true)
          print("Upload Failed")
       }
    } else {
        EZLoadingActivity.hide(success: false, animated: true)
        print("Error")
    }
}

######Showing EZLoadingActivity for a certain time:

EZLoadingActivity.showWithDelay("Waiting...", disableUI: false, seconds: 2)

######Showing EZLoadingActivity from App Window(For example: for Split view controller):

EZLoadingActivity.Settings.LoadOverApplicationWindow = true

No object tracking:

EZLoadingActivity is a singleton object so you don't need to keep track of its instance.

##Installation (~10 seconds)

  1. Download and drop 'EZLoadingActivity.swift' in your project.
  2. Congratulations!

Install via Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate EZLoadingActivity into your Xcode project using Carthage, specify it in your Cartfile:

github "goktugyil/EZLoadingActivity"

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

Then on the top of files where you are going to use this:

import EZLoadingActivity

Install via CocoaPods

You can use CocoaPods to install EZLoadingActivity by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!

pod 'EZLoadingActivity' #Stable release for Swift 3.0

pod 'EZLoadingActivity', :git => 'https://github.com/goktugyil/EZLoadingActivity.git' #Latest release for Swift 3.0
pod 'EZLoadingActivity', '~> 0.8' #For Swift 2.2

Then on the top of files where you are going to use this:

import EZLoadingActivity

##Requirements

  • Xcode 6 or later (Tested on 7)
  • iOS 7 or later (Tested on 9)

##Possible features

##License EZLoadingActivity is available under the MIT license. See the LICENSE file.

##Keywords swift, hud, loading, activity, progresshud, progress, track, spinner,

Comments
  • Orientation issue

    Orientation issue

    Thanks for the lovely simple-to-use control.

    I noticed however that it doesn't support landscape orientation. It keeps showing the animation based on the initial portrait orientation.

    opened by polis80cy 11
  • The view isn't in the centre when in a VC that is presented modally or is the master/detail

    The view isn't in the centre when in a VC that is presented modally or is the master/detail

    I tried to present an EZLoadingActivity in a Form Sheet view controller and it is off centred. It appears at about the bottom left corner of the form sheet. It isn't centred either when it is in a master-detail view controller.

    To reproduce, create a view controller A in the storyboard. Add a button that triggers a segue like this:

    screen shot 2016-06-30 at 5 06 53 pm screen shot 2016-06-30 at 5 07 14 pm

    Connect the segue to view controller B.

    In view controller B viewDidLoad, show the EZLoadingActivity.

    I think this is due to showing the view in the window. Can you do something about it so that it always appears centered in the current view controller?

    opened by Sweeper777 8
  • Loading indicator doesnt hide

    Loading indicator doesnt hide

    Hi, The indicator doesnt hide when i call the hide method. But this hide after a few second after i passed on the hide method ( +/-10 seconds)

    After this, when i continue to press my button for show the indicator, this doesnt show.

    opened by Persilos 6
  • Warning:

    Warning: "Result of call to 'hide(_:animated:)' is unused"

    Hi, Your loading indicator works well. However, Xcode alaway gives warnings of "Result of call to hide(_:animated:)' is unused and also in the case of show(). How could I deal with this?

    opened by yuchenglin 5
  • Separate instantiation from showing the view. Otherwise it can happen…

    Separate instantiation from showing the view. Otherwise it can happen…

    … that you end up in a situation where the UI is blocked.

    In the original version where instantiation and showing is done in one step (dispatch main) it can be that the dispatch didn't occur when you call the hide method. Hide is checking as a first step if there is an instance, which is not, because the main thread didn't elaborate it yet, and exits. Then at a point in time the main thread is showing the Indicator with blocking id, and never gets dismissed.

    With this change the instance is there, even if it hasn't been shown and as both showing and hiding happen in the same thread (main) it will be shown and immediately hidden, and the UI is unblocked.

    opened by hons82 4
  • View is pretty large on Ipad

    View is pretty large on Ipad

    Hey

    I love your implementation of this and how simple it is to use! Tried it for Ipad but it covered almost the entire screen which is a bit brute :D So I added this setting which let's you manually set the width divider (standard was 1.6)

    Probably not the prettiest way to add to it but it works and it's a very fast enhancement :)

    In Settings struct static var CLAWidthDivision = 1.6 In loadingActivity: let width = sender.view.frame.width / CGFloat(Settings.CLAWidthDivision) Before calling showMethod: CozyLoadingActivity.Settings.CLAWidthDivision = 4.6 (about right for Ipad)

    Thanks again!

    PS don't use github that much so thought I'd add it here and you can mark it as enhancement or something :) Cheers

    opened by NickBols 4
  • Convert to Swift 3 syntax

    Convert to Swift 3 syntax

    This pull request converts the framework to Swift 3 syntax. It would be best to move the old version to a Swift-2 branch before merging this pull request.

    opened by rugheid 3
  • Swift 3 issue

    Swift 3 issue

    I see commits 3 days ago that indicate Swift 3 support. But, I get 40 compiler errors when I include your pod: basic pre-Swift 3 stuff like "NSTimeInterval has been renamed to "TimeInterval". I've cleaned the pod cache, reinstalled. Can you help me?

    opened by Jiropole 2
  • EZLoadingActivity: You don't have an activity Instance?

    EZLoadingActivity: You don't have an activity Instance?

    I'm getting an EZLoadingActivity: You don't have an activity Instance problem when trying to call up EZLoadingActivity.hide(success: false, animated: true)

    opened by jgebbeken 2
  • LoadingActivity doesn't hide if scrolling started

    LoadingActivity doesn't hide if scrolling started

    Lets get to it quickly, lets say we have UITableView and I've showed the LoadingActivity Success and i immediately started scrolling to the bottom, so the LoadingActivity will stay showing until i stop my scroll then it will disappear. why is that ? it should disappear in anyway whenever i scroll or not in a specific time ! Thanks,

    bug 
    opened by AaoIi 2
  • What is the correct way to change the text while the loading activity is presented?

    What is the correct way to change the text while the loading activity is presented?

    I want to show the user the progress of the time-consuming task that I'm performing. Let's say I want to first show "Performing Task 1 of 10". After the first task is completed, I want to change the text to say "Performing Task 2 of 10" and so on. And after performing all tasks, I want to hide it.

    Do I just simply call show with different text multiple times?

    opened by Sweeper777 1
  • Feature Request: Optionally show the loading activity as a subview of the window?

    Feature Request: Optionally show the loading activity as a subview of the window?

    Currently, the LoadingActivity view seems to be added as a subview of the topViewController. This means that I cannot show the loading activity, and keep it showing while I perform a segue that goes to another VC.

    I think adding the loading activity as a subview of the window should fix this, but this would not work if the view controller is not full screen (see #23). Therefore, I think it would be best to provide an option to add the loading activity to the window.

    Either:

    • Accept a UIViewController? parameter in show. When this is nil, show the loading activity in the window, otherwise show it as a subview of the view of the VC, or
    • Accept a Bool parameter called showAsSubviewOfWindow. This won't break existing code.

    Do you think this is a good idea?

    opened by Sweeper777 1
  • add completion handler to showWithDelay()

    add completion handler to showWithDelay()

    Suggest an additional param for EZLoadingActivity.showWithDelay().

    completion callback/handler makes this method far more useful:

    @discardableResult
    public static func showWithDelay(_ text: String, disableUI: Bool, seconds: Double, completion: (() -> Void)? = nil) -> Bool {
        let showValue = show(text, disableUI: disableUI)
        delay(seconds) { () -> () in
            _ = hide(true, animated: false)
           completion?()
        }
        return showValue
    }
    
    opened by fetzig 0
  • Multiline text in loader

    Multiline text in loader

    I want to add a big text in loader

    We are downloading your records now. Please wait as this can take some time...

    But it appears so small when I use a big text and extra text got truncated.

    Is there any way to use multiline text in this library?

    Thanks in advance.

    opened by anik123 0
  • Text is not visible with indicator

    Text is not visible with indicator

    EZLoadingActivity.show("Updating Expense", disableUI: true)

    i am using EZLoadingActivity to show indicator with text. But on some screen text is not visible with indicator. How can i resolve this issue ?

    bug 
    opened by zeshanarif 3
Owner
Goktug Yilmaz
World-class code copy paster.
Goktug Yilmaz
A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.

A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8 and up. Features Official iOS 8 blur effect via UIVisualEffects

Philip Kluz 3.7k Jan 9, 2023
Customizable HUD for swift

HUD Customizable HUD. Requirements Installation Swift Package Manager The Swift Package Manager is a tool for automating the distribution of Swift cod

Horizontal Systems 1 Oct 6, 2022
Lightweight Swift loading activity for iOS7+

EZLoadingActivity Lightweight Swift loading activity for iOS7+. Really simple to use, just add the class and write 1 line of code. Easy to use: EZLoad

Goktug Yilmaz 611 Dec 22, 2022
A lightweight and awesome loading Activity Indicator for your iOS app.

BPCircleActivityIndicator BPCircleActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on

Ben.Park 46 Aug 12, 2022
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

BPBlockActivityIndicator BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iO

Ben.Park 43 Nov 6, 2021
SwiftUI view that download and display image from URL and displaying Activity Indicator while loading .

ViewWithActivityIndicator ViewWithActivityIndicator is a SwiftUI view that download and display image from URL and displaying Activity Indicator while

Ali Adam 28 Feb 3, 2022
Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (iOS7+ and OS X 10.9+ compatible)

Async.legacy Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch (GCD) Async rewritten for iOS7 and OS X 10.9 Compatibility

Joseph Lord 31 Jul 1, 2019
A UINavigationController's category to enable fullscreen pop gesture with iOS7+ system style.

FDFullscreenPopGesture An UINavigationController's category to enable fullscreen pop gesture in an iOS7+ system style with AOP. Overview 这个扩展来自 @J_雨 同

null 5.9k Dec 28, 2022
iOS7 style drop in replacement for UISwitch

SevenSwitch iOS7 style drop in replacement for UISwitch Usage Cocoapods pod 'SevenSwitch', '~> 2.1' Swift support was added in version 2.0. If your p

Ben Vogelzang 779 Sep 5, 2022
A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.

SwiftUIAsyncContentView A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.. Installa

CypherPoet 0 Dec 26, 2021
Lightweight and customisable async image loading in SwiftUI. Supports on-disk storage, placeholders and more!

Asyncrounously download and display images in Swift UI. Supports progress indicators, placeholders and image transitions. RemoteImageView Asyncrounous

Callum Trounce 192 Dec 7, 2022
A lightweight loading animation that can be applied to any SwiftUI view with 1 line of code.

SimpleAFLoader A lightweight loading animation that can be applied to any SwiftUI view with 1 line of code. All animations are built using the SwiftUI

Fahim Rahman 2 Aug 25, 2022
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest

SwiftSpinner SwiftSpinner is an extra beautiful activity indicator with plain and bold style. It uses dynamic blur and translucency to overlay the cur

Marin Todorov 2.1k Dec 19, 2022
The easiest way to handle a simple full screen activity indicator in iOS. Written in Swift.

LLSpinner An easy way to handle full screen activity indicator. Easy to use Get Started // Show spinner LLSpinner.spin() // Hide spinner LLSpinner.st

Aleph Retamal 36 Dec 9, 2021
Location, motion, and activity recording framework for iOS

LocoKit A Machine Learning based location recording and activity detection framework for iOS. Location and Motion Recording Combined, simplified Core

Matt Greenfield 1.5k Jan 2, 2023
Progress and Activity Indicators for iOS apps

Progress Indicators and Activity Views for iOS Apps Features Storyboard compatible, configure apprearance with the property inspector. fully animated,

Alexander Kasimir 101 Nov 13, 2022
Automatically sets the network activity indicator for any performed request.

BigBrother BIG BROTHER IS WATCHING YOU. BigBrother is a Swift library made for iOS that automatically watches for any performed request and sets the n

Marcelo Fabri 446 Dec 17, 2022
Inspect the iOS 15 App Activity Data directly on device.

AppActivityViewer About AppActivityViewer helps to inspect the iOS 15 App Activity Data easily on device. Choose App Activity at share sheet after cli

CJ 15 Mar 30, 2022
[iOS] Easy, customizable notifications displayed on top of the statusbar. With progress and activity. iPhone X ready.

JDStatusBarNotification Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an act

M Emrich 3.8k Dec 27, 2022
SwiftUI App to view the App Activity Record from iOS 15

App Activity Viewer A viewer for the iOS 15 "Record App Activity" export. FAQ How do I create an App Activity Report? Go to the "Settings" app of your

Jannik Arndt 13 Nov 16, 2022