I want to realize a function about changing password,it requires user to input his previous password,and I design it in a alert dialog,I want to click the button "Confirm the modification" then jump to the other view controller for changing password.I have written some code,but I don't know how to write in the next moment.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
You will get all added textfields from alert controller by its
textFields
readonly property, you can use it to get its text. LikeSwift 4:
Note: textField.text is optional, unwrap it before using
Objective-C:
By
[[alertController textFields][0] text]
this line, it will take first textfield added to the alerController and get its text.Here is an updated answer for Swift 4.0 that creates the desired kind of textfield:
And how it looks when first presented:
And while accepting text:
You can add multiple textfields to alert controller and access them with alert controller's textFields property
If new password is empty string, present the alert again. Or another way.. first disable Confirm button, enable it only when text field has text