Skip to content

Instantly share code, notes, and snippets.

@arslanbilal
Created December 14, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arslanbilal/83d9b24790551971085cf683553a5cab to your computer and use it in GitHub Desktop.
Save arslanbilal/83d9b24790551971085cf683553a5cab to your computer and use it in GitHub Desktop.
NetworkActivity
//
// JuxNetworkActivityIndicator.swift
// Bilal Arslan
//
// Created by BILAL ARSLAN on 14.12.2018.
// Copyright © 2018 BILAL ARSLAN. All rights reserved.
//
import UIKit
class JuxNetworkActivityIndicator {
private static var loadingCount = 0
class func add() {
if loadingCount == 0 {
UIApplication.shared.isNetworkActivityIndicatorVisible = true
}
loadingCount += 1
}
class func remove() {
if loadingCount > 0 {
loadingCount -= 1
}
if loadingCount == 0 {
UIApplication.shared.isNetworkActivityIndicatorVisible = false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment