Alamofire network activity indicator not showing

Hi guys, I'm trying to use AlamofireNetworkActivityIndicator (v2.2) and Alamofire (v4.5), but I can't get it to work. I have a Singleton in which I execute requests. this is an example request coming from my Singleton class

     Alamofire.request(Constants.getTimeline, method: .get, parameters: param, encoding: URLEncoding.default, headers: header).responseData() { response in
            switch (response.result) {
            case .success(let value):
                let json = JSON(data: value)
                callback(json)
            case .failure(_):
                callback(nil)
            }
        }

And I initialize AlamofireNetworkActivityIndicator in AppDelegate.swiftin functiondidFinishLaunchingWithOptions

NetworkActivityIndicatorManager.shared.isEnabled = true NetworkActivityIndicatorManager.shared.startDelay = 0 NetworkActivityIndicatorManager.shared.completionDelay = 10

competionDelay I'm trying to set any value, but still nothing helps. What could be a problem for the network indicator to appear in the status bar?

+4
source share

Source: https://habr.com/ru/post/1680029/


All Articles