Skip to content

Commit

Permalink
1. Show clear button in title field so users can easily clear title t…
Browse files Browse the repository at this point in the history
…o start over.

2. Placeholder should be set whether title is initially set or not. Otherwise, it will be empty if there is a preset title and user deletes it.
  • Loading branch information
an0 committed Jan 29, 2015
1 parent 869b21e commit bdca18f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ - (void)loadView {
UIView *paddingView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kTextLeftPadding, 0)];
titleField.leftView = paddingView1;
titleField.leftViewMode = UITextFieldViewModeAlways;
titleField.clearButtonMode = UITextFieldViewModeWhileEditing;
[self.view addSubview:titleField];
self.titleField = titleField;

Expand Down Expand Up @@ -122,9 +123,7 @@ - (void)loadView {

self.saveButtonItem.enabled = NO;
self.titleField.text = [self.delegate defaultNoteTitleForViewController:self];
if (self.titleField.text.length == 0) {
[self.titleField setPlaceholder:ENSDKLocalizedString(@"Add Title", @"Add Title")];
}
[self.titleField setPlaceholder:ENSDKLocalizedString(@"Add Title", @"Add Title")];

self.tagsView.placeholder = ENSDKLocalizedString(@"Add Tag", @"Add Tag");
}
Expand Down

0 comments on commit bdca18f

Please sign in to comment.