quick question! Sorry for noobiness in advance. I recentely started developing iOS applications and wanted to load a view for clicking a button. Im working in 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
The current error is "Editor is placeholder" for obj_LoadView = LoadView(frame: <#CGRect#>). I know I need to put something for CGRect, but unsure what. Any help is appreciated, thanks!