// // PDFBookmarkEditViewController.m // PDFReader // // Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved. // // The PDF Reader Sample applications are licensed with a modified BSD license. // Please see License for details. This notice may not be removed from this file. // #import "PDFBookmarkEditViewController.h" @interface PDFBookmarkEditViewController () @property (nonatomic,assign) IBOutlet UITextField *textField; @end @implementation PDFBookmarkEditViewController #pragma mark - Init Methods - (void)dealloc { Block_release(_callback); [_text release]; [super dealloc]; } #pragma mark - UIViewController Methods - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. self.title = NSLocalizedString(@"Edit bookmarks", nil); self.textField.text = self.text; [self.textField becomeFirstResponder]; } #pragma mark - UITextFieldDelegate - (BOOL)textFieldShouldReturn:(UITextField *)textField { [self.navigationController popViewControllerAnimated:YES]; if (self.callback) { self.callback(textField.text); self.callback = nil; } return YES; } @end