Skip to content

Commit

Permalink
change the delegate name
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujuan Bao committed Aug 13, 2010
1 parent fdcf496 commit 2a7aa09
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion sample/DemoApp/Classes/DemoAppViewController.m
Expand Up @@ -257,7 +257,7 @@ - (void)request:(FBRequest*)request didLoad:(id)result{
/**
* Called when a UIServer Dialog successfully return
*/
- (void)dialogDidSucceed:(FBDialog*)dialog{
- (void)dialogDidComplete:(FBDialog*)dialog{
[self.label setText:@"publish successfully"];
}

Expand Down
12 changes: 6 additions & 6 deletions src/FBDialog.h
Expand Up @@ -127,27 +127,27 @@
/**
* Called when the dialog succeeds and is about to be dismissed.
*/
- (void)dialogDidSucceed:(FBDialog *)dialog;
- (void)dialogDidComplete:(FBDialog *)dialog;

/**
* Called when the dialog succeeds with a returning url.
*/
- (void)dialogSucceedWithUrl:(NSURL *)url;
- (void)dialogCompleteWithUrl:(NSURL *)url;

/**
* Called when the dialog get canceled by the user.
*/
- (void)dialogCancelWithUrl:(NSURL *)url;
- (void)dialogDidNotCompleteWithUrl:(NSURL *)url;

/**
* Called when the dialog is cancelled and is about to be dismissed.
*/
- (void)dialogDidCancel:(FBDialog*)dialog;
- (void)dialogDidNotComplete:(FBDialog *)dialog;

/**
* Called when dialog failed to load due to an error.
*/
- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError*)error;
- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError *)error;

/**
* Asks if a link touched by a user should be opened in an external browser.
Expand All @@ -159,6 +159,6 @@
* should hold onto the URL and once you have received their acknowledgement open the URL yourself
* using [[UIApplication sharedApplication] openURL:].
*/
- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL*)url;
- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;

@end
16 changes: 8 additions & 8 deletions src/FBDialog.m
Expand Up @@ -597,12 +597,12 @@ - (void)show {

- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated {
if (success) {
if ([_delegate respondsToSelector:@selector(dialogDidSucceed:)]) {
[_delegate dialogDidSucceed:self];
if ([_delegate respondsToSelector:@selector(dialogDidComplete:)]) {
[_delegate dialogDidComplete:self];
}
} else {
if ([_delegate respondsToSelector:@selector(dialogDidCancel:)]) {
[_delegate dialogDidCancel:self];
if ([_delegate respondsToSelector:@selector(dialogDidNotComplete:)]) {
[_delegate dialogDidNotComplete:self];
}
}

Expand All @@ -625,15 +625,15 @@ - (void)dialogWillDisappear {

- (void)dialogDidSucceed:(NSURL *)url {

if ([_delegate respondsToSelector:@selector(dialogSucceedWithUrl:)]) {
[_delegate dialogSucceedWithUrl:url];
if ([_delegate respondsToSelector:@selector(dialogCompleteWithUrl:)]) {
[_delegate dialogCompleteWithUrl:url];
}
[self dismissWithSuccess:YES animated:YES];
}

- (void)dialogDidCancel:(NSURL *)url {
if ([_delegate respondsToSelector:@selector(dialogCancelWithUrl:)]) {
[_delegate dialogCancelWithUrl:url];
if ([_delegate respondsToSelector:@selector(dialogDidNotCompleteWithUrl:)]) {
[_delegate dialogDidNotCompleteWithUrl:url];
}
[self dismissWithSuccess:NO animated:YES];
}
Expand Down
2 changes: 1 addition & 1 deletion test/UnitTest/Classes/UnitTestViewController.m
Expand Up @@ -296,7 +296,7 @@ - (void)request:(FBRequest*)request didFailWithError:(NSError*)error{
///////////////////////////////////////////////////////////////////////////////////////////////////
// FBDialogDelegate

- (void)dialogSucceedWithUrl:(NSURL *)url {
- (void)dialogCompleteWithUrl:(NSURL *)url {
NSString *post_id = [self getStringFromUrl:[url absoluteString] needle:@"post_id="];

if (post_id.length > 0) {
Expand Down

0 comments on commit 2a7aa09

Please sign in to comment.