NVActivityIndicatorView icon indicating copy to clipboard operation
NVActivityIndicatorView copied to clipboard

Not able to add the custom message in loader

Open krishnaSoni2113 opened this issue 4 years ago • 1 comments

How I can add the custom loader message along with spinner? Below is my code.

class func showActivityIndicator(type: NVActivityIndicatorType? = nil, message: String? = nil)
{

    DispatchQueue.main.async {
        guard let window = UIApplication.sceneDelegate?.window else {
            return
        }
        NVActivityIndicatorView.DEFAULT_BLOCKER_MESSAGE = "Loading..." // Custom message
        NVActivityIndicatorView.DEFAULT_BLOCKER_MESSAGE_FONT = UIFont.systemFont(ofSize: 30)
        NVActivityIndicatorView.DEFAULT_TEXT_COLOR = UIColor.yellow
        let activityIndicatorView =  NVActivityIndicatorView(frame: window.frame , type: type)
        activityIndicatorView.backgroundColor = UIColor.black.withAlphaComponent(0.6)
        activityIndicatorView.padding = UIDevice.width - 150
        activityIndicatorView.startAnimating()
        window.addSubview(activityIndicatorView)
    }
}

krishnaSoni2113 avatar Jun 03 '21 10:06 krishnaSoni2113

You can put the animation and the text in an UIView and add it to window.

ninjaprox avatar Jun 04 '21 14:06 ninjaprox