Giter Site home page Giter Site logo

ezloadingactivity's Introduction

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,

ezloadingactivity's People

Contributors

bcylin avatar esqarrouth avatar hons82 avatar indrajitsinh avatar janlaussmann avatar lfarah avatar mahen3d avatar mustafaibrahim989 avatar radimhalfar avatar readmecritic avatar rugheid avatar serge-nanaev avatar sinss avatar sweeper777 avatar thellimist avatar toshi0383 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

ezloadingactivity's Issues

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.

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?

Swift 4.2 support?

When I install the pod in Swift 4.2, these errors popped up:

2018-11-04 9 55 50

My version is 1.01.

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,

Carthage support?

Are you planning to share this control via Carthage too? I know it's easy to install it direct but still I would like to add it via Carthage. Thanks

Update Library for Swift 5

Hi, I'm still using this library on my app, and I was hoping if you have any plans on updating it for Swift 5.

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?

Active activity verification

There is a way to verify if already have an active activity?

EZLoadingActivity: You still have an active activity, please stop that before creating a new one

Not work in container view

i have implemented your library, but it just only work on UIViewController, not work in container view.

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
}

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.

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

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.

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?

Swift 3

The framework should be converted to swift 3 syntax.

[WIP] travis-ci integration

what all you think about integrating travis-ci in this project ?

i could able to do it , let me tell your thoughts

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 ?

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?

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.