快速提问!对不起,提前noobiness。我最近开始开发 iOS 应用程序并想加载一个用于单击按钮的视图。我在swift4工作。
@IBAction func btnAddItem_AddDrinks_Click(_ sender: Any) {
//[self dismissViewControllerAnimated:YES completion:nil];
//[self.navigationController popViewControllerAnimated:YES];
if strIsSpecial == nil {
ValidationString.sharedManager().showAlert(withTitle: "", messageBody: "Please select either Regular, Special or Free")
}
else if ValidationString.sharedManager().isNullString(txtfldOunce.text!) == true {
// ValidationString.sharedManager().showAlert(withTitle: ALERT_TITLE, messageBody: "Ounce" + (ALERT_FIELD_SHOULD_NOT_BLANK))
let alert = UIAlertController(title: "Alert", message: "Ounces shouldn't be left blank", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
else if ValidationString.sharedManager().isNullString(txtfldUserReference_AddDrinks.text!) == true {
let alert = UIAlertController(title: "Alert", message: "Drink Name shouldn't be left blank", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
//ValidationString.sharedManager().showAlert(withTitle: ALERT_TITLE, messageBody: "Drink Name" + (ALERT_FIELD_SHOULD_NOT_BLANK))
}
else {
if view_Loading != nil {
view_Loading?.removeFromSuperview()
view_Loading = nil
obj_LoadView = nil
}
obj_LoadView = LoadView(frame: <#CGRect#>)
view_Loading = obj_LoadView?.showActivity("Loading....")
view.addSubview(view_Loading!)
view.isUserInteractionEnabled = false
当前的错误是 obj_LoadView = LoadView(frame: <#CGRect#>) 的“编辑器是占位符”。我知道我需要为 CGRect 放一些东西,但不确定是什么。任何帮助表示赞赏,谢谢!