DDShareViewController is designed to share Facebook Posts rapidly on small iOS devices.
- Easy to use, just like
MFMailComposeViewController
. - Allow to change privacy options with single tap.
- Support orientations, allow to rotate with keyboard or privacy options picker on.
- Support retina display, both iPhone 4 and 4th generation iPod touch.
- Use Facebook Application ID, no more Facebook API Key and Application Secret.
- Use Facebook Graphic API.
- DDShareServiceController is designed to support other web services, like Twitter. Just subclass it, then you can start to create your own DDShareViewController.
- iOS SDK 4 and LLVM compiler. (Sorry, no GCC 4.x) Demo project uses 4.2b3 SDK with LLVM compiler 1.6.
- Facebook iOS SDK, included in the project as git submodule.
- Apple's Reachability 2.2, inlcuded in the project.
Very similar to MFMailComposeViewController, initialize with DDShareServiceType
, fill the arguments with methods, then bring it up by calling -presentModalViewController:animated:
#import "DDShareViewController.h"
DDShareViewController *shareViewController = [[DDShareViewController alloc] initWithType:DDShareServiceTypeFacebook];
shareViewController.shareViewControllerDelegate = self;
[shareViewController setShareURL:@"http://digdog.tumblr.com/qremoji"];
[shareViewController setShareName:@"QR+Emoji for iPhone and iPod touch"];
[shareViewController setShareCaption:@"digdog software"];
[shareViewController setShareDescription:@"A unique and elegant QR Code utility for iPhone & iPod touch. Create QR Code with Emoji icon as visual hints, and scan QR Codes through camera or saved photos."];
[self presentModalViewController:shareViewController animated:YES];
[shareViewController release];
And setup DDShareViewControllerDelegate
. Unlike MFMailComposeViewControllerDelegate
, this is required:
- (void)shareViewController:(DDShareViewController *)controller didFinishWithResult:(DDShareServiceResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
Also, don't forget use your own kFacebookAppId
, it's defined in DDShareViewController.h.
DDSocialViewController is released under MIT License.