Skip to content

Commit

Permalink
Bump version to 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Jul 29, 2015
1 parent 7923d2c commit b41e998
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
15 changes: 11 additions & 4 deletions Example/MainWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<data>
<int key="IBDocument.SystemTarget">2048</int>
<string key="IBDocument.SystemVersion">14E46</string>
<string key="IBDocument.InterfaceBuilderVersion">7706</string>
<string key="IBDocument.InterfaceBuilderVersion">7702</string>
<string key="IBDocument.AppKitVersion">1348.17</string>
<string key="IBDocument.HIToolboxVersion">758.70</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">7703</string>
<string key="NS.object.0">7701</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
Expand Down Expand Up @@ -105,7 +105,7 @@
<string key="NSFrame">{{20, 130}, {280, 37}}</string>
<reference key="NSSuperview" ref="538351832"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="841852568"/>
<reference key="NSNextKeyView" ref="894322984"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
Expand All @@ -125,14 +125,15 @@
<string key="NSFrame">{{20, 174}, {280, 44}}</string>
<reference key="NSSuperview" ref="538351832"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="841852568"/>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUINormalTitleColor" ref="862019999"/>
<reference key="IBUIHighlightedTitleColor" ref="34193676"/>
<string key="IBUINormalTitle">Textfield with validation example</string>
<string key="IBUINormalTitle">TextField with validation example</string>
<reference key="IBUINormalTitleShadowColor" ref="823323164"/>
<reference key="IBUIFontDescription" ref="95042656"/>
<reference key="IBUIFont" ref="600433790"/>
Expand All @@ -144,6 +145,7 @@
<string key="NSFrame">{{20, 293}, {280, 45}}</string>
<reference key="NSSuperview" ref="538351832"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
Expand Down Expand Up @@ -364,6 +366,7 @@
<string key="showAlert1">id</string>
<string key="showAlert2">id</string>
<string key="showAlert3">id</string>
<string key="showAlert4WithTextField">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="showAlert1">
Expand All @@ -378,6 +381,10 @@
<string key="name">showAlert3</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="showAlert4WithTextField">
<string key="name">showAlert4WithTextField</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="status">UILabel</string>
Expand Down
19 changes: 13 additions & 6 deletions Example/OHAlertsExampleAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,23 @@ -(IBAction)showAlert3

-(IBAction)showAlert4WithTextField
{
OHAlertView *ohav = [[OHAlertView alloc] initWithTitle:@"Text field" message:@"Email:" cancelButton:@"Cancel" otherButtons:@[@"OK"] buttonHandler:^(OHAlertView *alert, NSInteger buttonIndex) {

OHAlertView *alert = [[OHAlertView alloc] initWithTitle:@"Email"
message:@"Enter a valid email xxx@yyy:"
cancelButton:@"Cancel"
otherButtons:@[@"OK"]
buttonHandler:^(OHAlertView *alert, NSInteger buttonIndex)
{
NSString* email = [alert textFieldAtIndex:0].text;
self.status.text = [NSString stringWithFormat:@"Email entered: %@", email];
}];

[ohav setShouldEnableFirstButton:^BOOL(OHAlertView* alert) {
NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"[0-9A-Za-z+.-_]+@[0-9A-Za-z.]+" options:0 error:nil];
[alert setShouldEnableFirstButton:^BOOL(OHAlertView* alert) {
NSString *email = [alert textFieldAtIndex:0].text;
return (email && email.length > 0);
return email && [regex numberOfMatchesInString:email options:0 range:NSMakeRange(0, email.length)] > 0;
}];
ohav.alertViewStyle = UIAlertViewStylePlainTextInput;
[ohav show];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
}

/////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion OHAlertView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.platform = :ios, '4.0'
s.name = "OHAlertView"
s.version = "2.1.0"
s.version = "2.2.0"
s.summary = "UIAlertView subclass that uses blocks to handle its callback (which make the code much more easier and readable)."
s.description = <<-DESC
UIAlertView subclass that uses blocks to handle the code to execute after the user tapped a button.
Expand Down

0 comments on commit b41e998

Please sign in to comment.