title: Is completion block syntax for MFMailComposeViewController mailComposeDelegate possible?
body: <p>I would like to use the <a href="http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html" rel="nofollow">MFMailComposeViewController</a> <code>mailComposeDelegate</code>property with completion block syntax, but not sure if that is possible.  Something similar to how the <a href="http://developer.apple.com/library/ios/#documentation/Twitter/Reference/TWTweetSheetViewControllerClassRef/Reference/Reference.html" rel="nofollow">TWTweetComposeViewController</a> <code>completionHandler</code> property works:</p>
  
  <pre><code>TWTweetComposeViewController __weak *twee = tweeter;
  tweeter.completionHandler = ^(TWTweetComposeViewControllerResult result) {
      // code here
  };
  </code></pre>
  
  <p>The code I have creates the MFMailComposeViewController, but then has to save a reference my <code>viewController</code> parameter, since this "share via email" functionality is not in a <code>UIViewcontroller</code>, but a custom <code>MYSharing</code> class.</p>
  
  <pre><code>MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
  // more code here
  _viewController = viewController;
  picker.mailComposeDelegate = self;
  [viewController presentModalViewController:picker animated:YES];
  </code></pre>
  
  <p>The <code>mailComposeController:didFinishWithResult:error:</code> from <a href="http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewControllerDelegate_protocol/Reference/Reference.html#//apple_ref/occ/intf/MFMailComposeViewControllerDelegate" rel="nofollow">MFMailComposeViewControllerDelegate</a> uses that <code>_viewController</code> to dismiss the modal.</p>
  
  <pre><code>- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
      [_viewController dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>Not understanding blocks very well, is there some syntax that look like this?</p>
  
  <pre><code>picker.mailComposeDelegate = ^(???)(??? ??? ???) {
      [viewController dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>I did find <a href="http://zwaldowski.github.com/BlocksKit/Documentation/Categories/MFMailComposeViewController+BlocksKit.html" rel="nofollow">MFMailComposeViewController(BlocksKit)</a> (which has source on github), but even with that, the syntax conversion trips me up.</p>