57 lines
1.6 KiB
Objective-C
57 lines
1.6 KiB
Objective-C
//
|
|
// EspagramAddWordToLessonViewController.m
|
|
// Espagram
|
|
//
|
|
// Created by Abel Fokkinga on 11/14/12.
|
|
// Copyright (c) 2012 Abel Fokkinga. All rights reserved.
|
|
//
|
|
|
|
#import "EspagramAddWordToLessonViewController.h"
|
|
|
|
@interface EspagramAddWordToLessonViewController ()
|
|
|
|
@end
|
|
|
|
@implementation EspagramAddWordToLessonViewController
|
|
|
|
@synthesize dataSource = _dataSource;
|
|
@synthesize wordLabel = _wordLabel;
|
|
@synthesize meaningLabel = _meaningLabel;
|
|
@synthesize wordInputText = _wordInputText;
|
|
@synthesize meaningInputText = _meaningInputText;
|
|
@synthesize addButton = _addButton;
|
|
@synthesize cancelButton = _cancelButton;
|
|
|
|
- (IBAction)editingDidEnd {
|
|
[self resignFirstResponder];
|
|
}
|
|
|
|
- (IBAction)verbEntered {
|
|
self.meaningInputText.text = [self.dataSource searchWordMeaning:self.wordInputText.text];
|
|
}
|
|
|
|
|
|
- (IBAction)addButtonPressed:(id)sender {
|
|
[self.dataSource addWord: self.wordInputText.text withMeaning:self.meaningInputText.text];
|
|
}
|
|
|
|
- (IBAction)cancelButtonPressed:(id)sender {
|
|
[self.dataSource cancelAddingWord];
|
|
}
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated
|
|
{
|
|
[super viewDidAppear:animated];
|
|
|
|
self.wordLabel.text = NSLocalizedString(@"New verb", @"Adding a new verb to a lesson");
|
|
self.meaningLabel.text = NSLocalizedString(@"Meaning", @"Adding the meaning of a new verb being added to a lesson");
|
|
|
|
[self.addButton setTitle:NSLocalizedString(@"Add Verb", @"Add button when adding a verb to a lesson") forState:UIControlStateNormal];
|
|
|
|
[self.cancelButton setTitle:NSLocalizedString(@"Cancel Verb",@"Cancel button to cancel adding a verb to a lesson") forState:UIControlStateNormal];
|
|
}
|
|
|
|
|
|
@end
|