Guest User

Untitled

a guest
Dec 14th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. //
  2. // JuxNetworkActivityIndicator.swift
  3. // Bilal Arslan
  4. //
  5. // Created by BILAL ARSLAN on 14.12.2018.
  6. // Copyright © 2018 BILAL ARSLAN. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class JuxNetworkActivityIndicator {
  12.  
  13. private static var loadingCount = 0
  14.  
  15. class func add() {
  16. if loadingCount == 0 {
  17. UIApplication.shared.isNetworkActivityIndicatorVisible = true
  18. }
  19. loadingCount += 1
  20. }
  21.  
  22. class func remove() {
  23. if loadingCount > 0 {
  24. loadingCount -= 1
  25. }
  26. if loadingCount == 0 {
  27. UIApplication.shared.isNetworkActivityIndicatorVisible = false
  28. }
  29. }
  30.  
  31. }
Add Comment
Please, Sign In to add comment