NVActivityIndicatorView
NVActivityIndicatorView copied to clipboard
Not able to add the custom message in loader
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)
}
}
You can put the animation and the text in an UIView and add it to window.