espagram/Espagram/EspagramNewLessonViewController.m
Abel Fokkinga 3013ee52c4 Version 1.1
- Added localised descriptions for all the tenses.
- After selecting a lesson, you will get a screen where you can see both the words in the lesson or start a multiple choice test.
- Lay-out fixes
- UI improvements
2013-01-02 17:33:00 -02:00

63 lines
1.8 KiB
Objective-C

//
// EspagramNewLessonViewController.m
// Espagram
//
// Created by Abel Fokkinga on 11/13/12.
// Copyright (c) 2012 Abel Fokkinga. All rights reserved.
//
#import "EspagramNewLessonViewController.h"
@interface EspagramNewLessonViewController ()
@end
@implementation EspagramNewLessonViewController
@synthesize nameLabel = _nameLabel;
@synthesize descriptionLabel = _descriptionLabel;
@synthesize addButton = _addButton;
@synthesize lessonDescriptionTextInput = _lessonDescriptionTextInput;
@synthesize lessonNameTextInput = _lessonNameTextInput;
@synthesize dataSource = _dataSource;
- (IBAction)editingDidEnd:(id)sender {
[self resignFirstResponder];
}
- (IBAction)addButtonPressed {
NSLog(@"Add button pressed with %@", self.lessonNameTextInput.text);
[self.dataSource addLesson:self.lessonNameTextInput.text withDescription:self.lessonDescriptionTextInput.text];
}
- (IBAction)cancelButtonPressed:(id)sender {
if ( !self.dataSource ) {
NSLog(@"dataSource is not set");
}
NSLog(@"Cancel button pressed");
[self.dataSource cancelLesson];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.nameLabel.text = NSLocalizedString(@"Lesson title", @"Lesson title when adding a new lesson");
self.descriptionLabel.text = NSLocalizedString(@"Description", @"Lesson description when adding a new lesson");
[self.addButton setTitle:NSLocalizedString(@"Add Lesson","Add button for adding a new lesson") forState:UIControlStateNormal];
[self.cancelButton setTitle:NSLocalizedString(@"Cancel Lesson","Cancel button when adding a new lesson") forState:UIControlStateNormal];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end