Skip to content

Commit

Permalink
Merge pull request #198 from auth0/bugifx-alert-without-buttons
Browse files Browse the repository at this point in the history
Fix Alerts without button
  • Loading branch information
hzalaz committed Dec 4, 2015
2 parents c29501a + 9f47232 commit 819d6c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Carthage/
.fabric_key

#Auth0 Lock
Auth0.plist
MyLock/Auth0.plist

#Carthage Cache
.carthage_cache.yml
2 changes: 2 additions & 0 deletions Lock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@
/* Begin PBXFileReference section */
5F6628A51C12062F008D73FC /* A0WebKitViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = A0WebKitViewController.xib; sourceTree = "<group>"; };
5F6628A61C12062F008D73FC /* A0WebViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = A0WebViewController.xib; sourceTree = "<group>"; };
5F6628A91C120F23008D73FC /* Auth0.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Auth0.plist; sourceTree = "<group>"; };
5FBACFF51BE7AF8700703DD1 /* Lock.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lock.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5FBACFF81BE7AF8700703DD1 /* Lock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Lock.h; sourceTree = "<group>"; };
5FBACFFA1BE7AF8700703DD1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1439,6 +1440,7 @@
5FBAD22D1BE7BE1E00703DD1 /* MyLock */ = {
isa = PBXGroup;
children = (
5F6628A91C120F23008D73FC /* Auth0.plist */,
5FBAD4751BE809EA00703DD1 /* A0HomeViewController.m */,
5FBAD4771BE809EA00703DD1 /* A0HomeViewController.h */,
5FBAD4791BE809EA00703DD1 /* A0SettingsViewController.h */,
Expand Down
13 changes: 8 additions & 5 deletions Lock/CoreUI/A0Alert.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ - (instancetype)init {
self = [super init];
if (self) {
_callbacks = [@{} mutableCopy];
_buttons = [@[] mutableCopy];
}
return self;
}
Expand All @@ -44,11 +45,13 @@ - (void)addButtonWithTitle:(NSString *)title callback:(A0AlertButtonCallback)cal
}

- (void)showInController:(UIViewController *)controller {
if ([UIAlertController class]) {
[self showAlerControllerFrom:controller];
} else {
[self showAlertView];
}
dispatch_async(dispatch_get_main_queue(), ^{
if ([UIAlertController class]) {
[self showAlerControllerFrom:controller];
} else {
[self showAlertView];
}
});
}

+ (A0Alert *)showInController:(UIViewController *)controller alert:(void(^)(A0Alert *alert))builder {
Expand Down

0 comments on commit 819d6c7

Please sign in to comment.