Makes search and library use the same monster detail view/controller.

This commit is contained in:
2020-09-12 02:16:14 -07:00
parent fa553a447a
commit edb1c672eb
2 changed files with 8 additions and 19 deletions

View File

@@ -46,8 +46,10 @@
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([@"ShowMonsterDetail" isEqualToString:segue.identifier]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
MonsterViewController *vc = (MonsterViewController*)segue.destinationViewController;
vc.monster = [self.allMonsters objectAtIndex:indexPath.row];
if ([segue.destinationViewController isKindOfClass:[MonsterViewController class]]) {
MonsterViewController *vc = (MonsterViewController*)segue.destinationViewController;
vc.monster = [self.allMonsters objectAtIndex:indexPath.row];
}
}
}