Skip to content

mtrudel/MTTextViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MTTextViewController

A simple delegate-based controller for presenting editable text on iOS.

Usage

In your presenting view controller, do:

- (IBAction)editNote {
  MTTextViewController *textViewController = [[MTTextViewController alloc] initWithText:self.noteText];
  textViewController.title = @"Edit Note";
  textViewController.delegate = self;
  // You can also push it on a navigation controller if you'd like
  [self presentViewController:[[UINavigationController alloc] initWithRootViewController:textViewController] animated:YES completion:nil];
}

- (void)textViewControllerDidFinish:(MTTextViewController *)controller {
  self.noteText = controller.text;
  [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)textViewControllerDidCancel:(MTTextViewController *)controller {
  [self dismissViewControllerAnimated:YES completion:nil];
}

Requirements

iOS 7 or greater.

Installation

MTTextViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MTTextViewController"

Author

Mat Trudel, mat@geeky.net

License

MTTextViewController is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages