uialertview - Put a gap in between two views in Swift Alert -
i created alert view 2 text field user enter details. alert view generated programmatically shown below. there way put gap in between 2 text field?.
let alertcontroller = uialertcontroller(title: "register", message: "", preferredstyle: .alert) alertcontroller.addaction(okaction) alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "name" textfield.keyboardtype = .emailaddress } alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "email" textfield.securetextentry = false } alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "company" textfield.securetextentry = false } self.presentviewcontroller(alertcontroller, animated: true) { // ... }
i can suggest better way. create custom xib file , use present view controller create alert box shown below.
let vc = customalertviewcontroller() self.presentviewcontroller(vc, animated: true, completion: nil)
you can refer following repo https://github.com/mattneub/custom-alert-view-ios7
Comments
Post a Comment