PDFBookmarkEditViewController.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // PDFBookmarkEditViewController.m
  3. // PDFReader
  4. //
  5. // Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // The PDF Reader Sample applications are licensed with a modified BSD license.
  8. // Please see License for details. This notice may not be removed from this file.
  9. //
  10. #import "PDFBookmarkEditViewController.h"
  11. @interface PDFBookmarkEditViewController ()
  12. @property (nonatomic,assign) IBOutlet UITextField *textField;
  13. @end
  14. @implementation PDFBookmarkEditViewController
  15. #pragma mark - Init Methods
  16. - (void)dealloc {
  17. Block_release(_callback);
  18. [_text release];
  19. [super dealloc];
  20. }
  21. #pragma mark - UIViewController Methods
  22. - (void)viewDidLoad {
  23. [super viewDidLoad];
  24. // Do any additional setup after loading the view from its nib.
  25. self.title = NSLocalizedString(@"Edit bookmarks", nil);
  26. self.textField.text = self.text;
  27. [self.textField becomeFirstResponder];
  28. }
  29. #pragma mark - UITextFieldDelegate
  30. - (BOOL)textFieldShouldReturn:(UITextField *)textField {
  31. [self.navigationController popViewControllerAnimated:YES];
  32. if (self.callback) {
  33. self.callback(textField.text);
  34. self.callback = nil;
  35. }
  36. return YES;
  37. }
  38. @end