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:
2020-09-11 23:39:50 -07:00
parent 327a640b83
commit 651a8e30d4
6 changed files with 165 additions and 36 deletions

View File

@@ -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