Permalink
Browse files

Modified demo to include prompt

  • Loading branch information...
1 parent 6fdaba0 commit ea2135673d5d45b8f103753904cb36b1562b090b @barrettj barrettj committed Feb 13, 2012
View
1 BlockAlertsDemo/BlockAlertsDemoViewController.h
@@ -18,6 +18,7 @@
- (IBAction)whatsArrived:(id)sender;
- (IBAction)arrivedBlog:(id)sender;
- (IBAction)dismissKeyboard:(id)sender;
+- (IBAction)showTextPrompt:(id)sender;
@property (retain, nonatomic) IBOutlet UITextField *testKeyboard;
View
12 BlockAlertsDemo/BlockAlertsDemoViewController.m
@@ -9,6 +9,7 @@
#import "BlockAlertsDemoViewController.h"
#import "BlockAlertView.h"
#import "BlockActionSheet.h"
+#import "BlockTextPromptAlertView.h"
@implementation BlockAlertsDemoViewController
@synthesize testKeyboard;
@@ -24,6 +25,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
- (IBAction)showAlert:(id)sender
{
BlockAlertView *alert = [BlockAlertView alertWithTitle:@"Alert Title" message:@"This is a very long message, designed just to show you how smart this class is"];
+
[alert setCancelButtonWithTitle:@"Cancel" block:nil];
[alert setDestructiveButtonWithTitle:@"Kill!" block:nil];
[alert addButtonWithTitle:@"Show Action Sheet on top" block:^{
@@ -81,6 +83,16 @@ - (IBAction)goNuts:(id)sender
}
}
+- (IBAction)showTextPrompt:(id)sender
+{
+ BlockTextPromptAlertView *alert = [BlockTextPromptAlertView promptWithTitle:@"Prompt Title" message:@"With prompts you do have to keep in mind limited screen space due to the keyboard" defaultText:@"some default text!"];
+
+
+ [alert setCancelButtonWithTitle:@"Cancel" block:nil];
+ [alert addButtonWithTitle:@"Okay" block:nil];
+ [alert show];
+}
+
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[self showAlert:nil];
View
128 BlockAlertsDemo/en.lproj/BlockAlertsDemoViewController.xib
@@ -42,7 +42,6 @@
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="800988127"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -58,7 +57,6 @@
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 229}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="829591862"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -92,7 +90,6 @@
<int key="NSvFlags">264</int>
<string key="NSFrame">{{14, 408}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="110267174"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -133,7 +130,6 @@
<int key="NSvFlags">264</int>
<string key="NSFrame">{{164, 408}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -158,7 +154,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{14, 337}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="928923351"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -186,7 +181,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{164, 337}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="96482141"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -211,7 +205,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{14, 237}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="412409552"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -239,7 +232,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{164, 237}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="588137559"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
@@ -265,10 +257,9 @@
<object class="IBUIButton" id="588137559">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{89, 288}, {142, 43}}</string>
+ <string key="NSFrame">{{14, 288}, {142, 43}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="513832477"/>
+ <reference key="NSNextKeyView" ref="627507782"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -295,7 +286,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{14, 198}, {103, 31}}</string>
<reference key="NSSuperview" ref="774585933"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="993033152"/>
<string key="NSReuseIdentifierKey">_NS:304</string>
<bool key="IBUIOpaque">NO</bool>
@@ -327,10 +317,36 @@
<int key="NSfFlags">16</int>
</object>
</object>
+ <object class="IBUIButton" id="627507782">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{164, 288}, {142, 43}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSNextKeyView" ref="513832477"/>
+ <string key="NSReuseIdentifierKey">_NS:225</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <double key="IBUIContentEdgeInsets.top">1</double>
+ <double key="IBUIContentEdgeInsets.bottom">0.0</double>
+ <double key="IBUIContentEdgeInsets.left">0.0</double>
+ <double key="IBUIContentEdgeInsets.right">0.0</double>
+ <string key="IBUITitleShadowOffset">{0, -1}</string>
+ <string key="IBUINormalTitle">Text Prompt</string>
+ <reference key="IBUIHighlightedTitleColor" ref="670373703"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC45MTMyNjUyOSAwLjg4NDU0OTAyIDAuNjAyMTI4MzkAA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="137772984"/>
+ <reference key="IBUINormalBackgroundImage" ref="231851259"/>
+ <reference key="IBUIFontDescription" ref="516573679"/>
+ <reference key="IBUIFont" ref="220889906"/>
+ </object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="669214360"/>
<reference key="IBUIBackgroundColor" ref="670373703"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@@ -436,6 +452,15 @@
</object>
<int key="connectionID">30</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">showTextPrompt:</string>
+ <reference key="source" ref="627507782"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">34</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -470,6 +495,7 @@
<reference ref="829591862"/>
<reference ref="588137559"/>
<reference ref="800988127"/>
+ <reference ref="627507782"/>
</array>
<reference key="parent" ref="0"/>
</object>
@@ -523,6 +549,11 @@
<reference key="object" ref="800988127"/>
<reference key="parent" ref="774585933"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">32</int>
+ <reference key="object" ref="627507782"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -539,82 +570,17 @@
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="32.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">31</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">BlockAlertsDemoViewController</string>
- <string key="superclassName">UIViewController</string>
- <dictionary class="NSMutableDictionary" key="actions">
- <string key="arrivedBlog:">id</string>
- <string key="dismissKeyboard:">id</string>
- <string key="goNuts:">id</string>
- <string key="showActionSheet:">id</string>
- <string key="showActionSheetPlusAlert:">id</string>
- <string key="showAlert:">id</string>
- <string key="showAlertPlusActionSheet:">id</string>
- <string key="whatsArrived:">id</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="actionInfosByName">
- <object class="IBActionInfo" key="arrivedBlog:">
- <string key="name">arrivedBlog:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="dismissKeyboard:">
- <string key="name">dismissKeyboard:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="goNuts:">
- <string key="name">goNuts:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="showActionSheet:">
- <string key="name">showActionSheet:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="showActionSheetPlusAlert:">
- <string key="name">showActionSheetPlusAlert:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="showAlert:">
- <string key="name">showAlert:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="showAlertPlusActionSheet:">
- <string key="name">showAlertPlusActionSheet:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo" key="whatsArrived:">
- <string key="name">whatsArrived:</string>
- <string key="candidateClassName">id</string>
- </object>
- </dictionary>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">testKeyboard</string>
- <string key="NS.object.0">UITextField</string>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">testKeyboard</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">testKeyboard</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/BlockAlertsDemoViewController.h</string>
- </object>
- </object>
- </array>
+ <int key="maxID">34</int>
</object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>

0 comments on commit ea21356

Please sign in to comment.