-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
228 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
StoryboardRecipes/StoryboardRecipes/PRPDirectionsEditorViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// PRPDirectionsEditorViewController.h | ||
// StoryboardRecipes | ||
// | ||
// Created by usr0600239 on 2013/02/13. | ||
// Copyright (c) 2013年 kentarok.org. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@class PRPRecipe; | ||
|
||
@interface PRPDirectionsEditorViewController : UIViewController | ||
<UITextViewDelegate> | ||
|
||
@property(nonatomic, strong) PRPRecipe *recipe; | ||
@property(nonatomic, strong) IBOutlet UITextView *textView; | ||
|
||
@end |
55 changes: 55 additions & 0 deletions
55
StoryboardRecipes/StoryboardRecipes/PRPDirectionsEditorViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// PRPDirectionsEditorViewController.m | ||
// StoryboardRecipes | ||
// | ||
// Created by usr0600239 on 2013/02/13. | ||
// Copyright (c) 2013年 kentarok.org. All rights reserved. | ||
// | ||
|
||
#import "PRPDirectionsEditorViewController.h" | ||
#import "PRPRecipe.h" | ||
|
||
@interface PRPDirectionsEditorViewController () | ||
|
||
@end | ||
|
||
@implementation PRPDirectionsEditorViewController | ||
|
||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | ||
{ | ||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | ||
if (self) { | ||
// Custom initialization | ||
} | ||
return self; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[super viewWillAppear:animated]; | ||
self.title = @"Edit Directions"; | ||
[self.textView becomeFirstResponder]; | ||
self.textView.text = self.recipe.directions; | ||
} | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view. | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated { | ||
[super viewWillDisappear:animated]; | ||
[self.textView resignFirstResponder]; | ||
} | ||
|
||
- (void)didReceiveMemoryWarning | ||
{ | ||
[super didReceiveMemoryWarning]; | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
- (void)textViewDidEndEditing:(UITextView *)textView { | ||
self.recipe.directions = self.textView.text; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.