How to add Progress bar to UIAlertController?

后端 未结 4 1308
终归单人心
终归单人心 2021-01-31 21:39

I want to add progress bar in swift iOS 8 UIAlertController. Is this possible? Is there any way to subclass UIAlertController and add progres bar and connect some delegate funct

4条回答
  •  滥情空心
    2021-01-31 22:18

    func downloadAlert() {
            let alertController = UIAlertController(title: "Title", message: "Loading...", preferredStyle: .Alert)
    
            let progressDownload : UIProgressView = UIProgressView(progressViewStyle: .Default)
    
            progressDownload.setProgress(5.0/10.0, animated: true)
            progressDownload.frame = CGRect(x: 10, y: 70, width: 250, height: 0)
    
        alertController.view.addSubview(progressDownload)
        presentViewController(alertController, animated: true, completion: nil)
    }
    

提交回复
热议问题