mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +00:00
44 lines
No EOL
942 B
Objective-C
44 lines
No EOL
942 B
Objective-C
//
|
|
// Created by Sami Samhuri on 15-04-24.
|
|
// Copyright (c) 2015 Guru Logic Inc. All rights reserved.
|
|
//
|
|
#import "ChangeTitleViewController.h"
|
|
|
|
@interface ChangeTitleViewController () <UITextFieldDelegate>
|
|
|
|
@property (nonatomic, weak) IBOutlet UITextField *titleField;
|
|
|
|
@end
|
|
|
|
@implementation ChangeTitleViewController
|
|
|
|
@synthesize articleTitle = _articleTitle;
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
self.titleField.text = _articleTitle;
|
|
[self.titleField becomeFirstResponder];
|
|
}
|
|
|
|
- (NSString *)articleTitle {
|
|
if (self.titleField) {
|
|
return self.titleField.text;
|
|
}
|
|
return _articleTitle;
|
|
}
|
|
|
|
- (void)setArticleTitle:(NSString *)articleTitle {
|
|
_articleTitle = [articleTitle copy];
|
|
if (self.titleField) {
|
|
self.titleField.text = articleTitle;
|
|
}
|
|
}
|
|
|
|
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
|
if (self.dismissBlock) {
|
|
self.dismissBlock();
|
|
}
|
|
return NO;
|
|
}
|
|
|
|
@end |