簡単な質問!事前にnoobinessのため申し訳ありません。私は最近、iOSアプリケーションの開発を開始し、ボタンをクリックするためのビューをロードしたいと考えました。私はswift4で働いています。Loading View in Swift
@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メソッド(フレーム:<#CGRect#>)のための "Editorがプレースホルダである" です。私はCGRectのために何かを置く必要があることを知っていますが、何がわかりません。どんな助けでも感謝しています!
iOSアプリケーションの開発を始めたばかりなので*命名ガイドラインに従ってください。 Swift/Objective-CのPHPやJavaScriptの変数名とは異なり、* snake_cased *ではなくcamelCased *とします。適切な 'CGRect'を渡す必要があります。最も簡単な値は '.zero'ですが、非ゼロの' width'と 'height'を指定する必要があります。 – vadian