A FacebookConnect look-alike UIView dialog
I am working on an iPhone/iPad universal app these two weeks, and it allows user to share over Facebook, Twitter or Plurk social services.
And since FacebookConnect SDK had provided a well-known dialog design, I would like to follow it, and to create a similar dialog UI for consistent user experiences in my app.
DDSocialDialog

DDSocialDialog is a UIView subclass looks like FacebookConnect dialog. And it comes with some features:
- Easy to use, just like UIAlertView.
- A DDSocialDialog dialog with an empty contentView for customizing.
- A extended DDSocialLoginDialog dialog for retrieving username and password.
- Two themes: Twitter and Plurk. And you can create your own if you like.
- Optimized for different resolutions, including iPhone, iPad and iPhone 4 (Retina Display, 960 by 640).
- Support orientations, you can rotate with keyboard on or off. This part is acting better than FacebookConnect SDK.
How To Use
Very similar to UIAlertView. For DDSocialDialog, you can init with your prefer size (frame.origin is ignored) and theme:
DDSocialDialog *blankDialog = [[DDSocialDialog alloc]
initWithFrame:CGRectMake(0., 0., 600., 500.)
theme:DDSocialDialogThemeTwitter];
blankDialog.dialogDelegate = self;
blankDialog.titleLabel.text = @"My Twitter Dialog";
[blankDialog.contentView addSubview:self.mySubview];
[blankDialog show];
[blankDialog release];
And the DDSocialDialogDelegate will call -socialDialogDidCancel: when user clicked top-right cancel button.
For the DDSocialLoginDialog, it is even easier, you don’t need to care about login dialog size, it’s been optimized for both iPhone and iPad with keyboard on and off. Just init with delegate and theme:
DDSocialLoginDialog *loginDialog = [[DDSocialLoginDialog alloc]
initWithDelegate:self
theme:DDSocialDialogThemePlurk];
[loginDialog show];
[loginDialog release];
And the DDSocialLoginDialogDelegate will call -socialDialogDidSucceed: when user clicked “Sign In” button. Then you can have the username and password through socialLoginDialog.username and socialLoginDialog.password properties.
Where To Download
The source code is available on my github.
DDSocialDialog and the demo are licensed under MIT and Apache 2.0 licenses.
















