web-differently / DEComposeViewController

A generic message view controller using the style of iOS compose view controllers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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];

About

A generic message view controller using the style of iOS compose view controllers