我正在通过自定义类加载视图实现加载概念。我需要通过使用 simpleself.show()和self.dismissfunction 来使用这个自定义类。UIActivityController在这里,我通过使用inside实现了这个概念UIAlertView,但我需要使用自定义类来实现这一点。
下面的代码是我通过使用UIActivityController内部实现的UIAlertView
func loadinHubShow() {\n let alert = UIAlertController(title: nil, message: "Please wait...", preferredStyle: .alert)\n let loadingIndicator = UIActivityIndicatorView(frame: CGRect(x: 10, y: 5, width: 50, height: 50))\n loadingIndicator.hidesWhenStopped = true\n loadingIndicator.style = UIActivityIndicatorView.Style.gray\n loadingIndicator.startAnimating();\n alert.view.addSubview(loadingIndicator)\n present(alert, animated: true, completion: nil)\n }\n\nfunc loadinHubDismiss() {\n dismiss(animated: false, completion: nil)\n}\nRun Code Online (Sandbox Code Playgroud)\n\n如何将其更改为自定义类loading view。我不想在 xe2x80x99UIActivityController内使用UIAlertView,或者需要UI design通过 来创建相同的外观和感觉UIView。
