how to get input from UIAlertView?
I want take player name as input by using UIAlertView. Is it possible to add textField on the UIAlertView?
- Objective-C - Disadvantages to Bridging With C++?
- Swift access to C Struct
- Cannot convert value of type 'CFString' to expected argument type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')
- Convert NSData bytes to NSString?
- Notify app when iPad date time settings changed
- Prevent Flash in Cocoa WebView
3 Solutions Collect From Internet About “how to get input from UIAlertView?”
Yes, it’s definitely possible, and it isn’t a hack. You would need to subclass UIAlertView and place controls into it. Since it’s a subclass, it will retain the same look & feel, etc.
For full details, see this tutorial by Jeff LaMarche (co-author of Beginning iPhone Development, from Apress).
Since iOS 5, UIAlertView provides this: change the alertViewStyle property to one of the following:
UIAlertViewStylePlainTextInput (1 text field) UIAlertViewStyleSecureTextInput (1 password field) UIAlertViewStyleLoginAndPasswordInput (both a text field and password field)
textFieldAtIndex: to get the text field you want. This way, you can even use the
alertViewShouldEnableFirstOtherButton: delegate method to enable the button.
Yes, but not without some hacking, see this previous question.
You’d have to directly manipulate the UIAlertView’s subviews and add a UITextField and then resize the UIAlertView’s frame. You’re better off creating your own view.
- Removing Firebase authState upon viewDidDisappear
- iOS Swift Multiple dimension arrays – compiliing takes ages. What should I change?
- Center UIButton programmatically
- Loading annotations from url using background thread. Pins doesn't show before moving or scaling mapView
- How to send mail from iphone app without showing MFMailComposeViewController?
- Extremely weird behavior of navigationBar and MPMoviePlayerController. Bug in iOS or my error?
- In Metal, does setting vertex and fragment buffer to same MTLBuffer copies it to GPU only once?
- App crashing when using Firebase Auth, reason: 'Default app has already been configured.'
- iPhone rangeOfString
- DateFormatter.localizedString is broken for some of the dates
- Repeat UILocalNotification on Specific day
- UITextField : restrict the maximum allowed value (number) during inputting
- No installed provisioning profiles match the installed iOS code signing keys
- collectionViewContentSize() vs contentSize
- What's the difference between _variable & self.variable in Objective-C?