Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.23 KB

README.md

File metadata and controls

36 lines (24 loc) · 1.23 KB

DEComposeViewController

A generic message entry view controller using the style of iOS compose view controllers (like tweet sheets).

Based on the excellent tweet sheet based control DETweetComposeViewController from DoubleEncore.

Example Usage

DEComposeViewControllerCompletionHandler completionHandler = ^(DEComposeViewControllerResult result, NSString* message, UIImage* image, NSString* lat, NSString* lon) {
  switch (result) {
    case DEComposeViewControllerResultCancelled:
      NSLog(@"Note Result: Cancelled");
      break;
    case DEComposeViewControllerResultDone:
      NSLog(@"Note Result: Done");
      break;
  }
  [self dismissModalViewControllerAnimated:YES];
};

DEComposeViewController *composeVC = [[DEComposeViewController alloc] init];
self.modalPresentationStyle = UIModalPresentationCurrentContext;

// add an image to the sheet
[composeVC addImage:image];

composeVC.completionHandler = completionHandler;
[self presentModalViewController:composeVC animated:YES];