Created
July 4, 2014 23:47
-
-
Save spnkr/7183cca5feef523d6e24 to your computer and use it in GitHub Desktop.
BW::UIAlertView with a text field, password field, or both
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/rubymotion/BubbleWrap | |
``` ruby | |
#options | |
opts = { | |
title:"A question", | |
message:"A description.", | |
buttons:["Cancel","Okay!"], | |
cancel_button_index:0 | |
} | |
#make an alert view with one plain text field | |
alert = BW::UIAlertView.plain_text_input(opts).on_click do |al| | |
user_typed_this_text = al.plain_text_field.text | |
if al.clicked_button.index==0 | |
#clicked the Cancel button | |
else | |
#clicked the Okay! button | |
end | |
end | |
# show it | |
alert.show | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment