Makes the library view display a list of monsters.
Makes the library view ad search view share a view controller for their destination.
This commit is contained in:
@@ -18,9 +18,32 @@
|
||||
[super viewDidLoad];
|
||||
if (self.monsterName != nil) {
|
||||
self.monsterName.text = self.monster.name;
|
||||
} else if (self.navigationItem != nil && self.navigationItem.title != nil) {
|
||||
} else if (self.navigationItem != nil) {
|
||||
self.navigationItem.title = self.monster.name;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
// TODO: get the latest version of this monster from CoreData
|
||||
if (self.monsterName != nil) {
|
||||
self.monsterName.text = self.monster.name;
|
||||
} else if (self.navigationItem != nil) {
|
||||
if (self.monster.name == nil) {
|
||||
self.navigationItem.title = @"Unnamed Monster";
|
||||
} else {
|
||||
self.navigationItem.title = self.monster.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)unwindWithSegue:(UIStoryboardSegue *)unwindSegue {
|
||||
// UIViewController *sourceViewController = unwindSegue.sourceViewController;
|
||||
// Use data from the view controller which initiated the unwind segue
|
||||
}
|
||||
|
||||
#pragma mark - Navigation
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user