How to programmatically create a button-transition in the prototype cell, with the possibility of returning in the future (Navigation Controller)? There is an idea to put a UIButton in a cell, set a tag and then manipulate it, but it seems to me wrong in this case) There must be something standard for the prototype cell as shown in the screenshot
It is worth noting that the button press event needs to be processed (I will transfer data to the next form, indicating what to show) Creating a kind of tree
Cell creation:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath{ UITableViewCell *cell; cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; // ячейка if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"]; } // Выводим, обращаясь к тэгам NSError *error = nil; id object = [NSJSONSerialization JSONObjectWithData:receivedData options:NSJSONReadingAllowFragments error:&error]; UILabel *firstLabel; firstLabel = [cell.contentView viewWithTag:1001]; firstLabel.text = [namesDepart[indexPath.row] objectForKey:@"Name"]; UILabel *secondLabel; secondLabel = [cell.contentView viewWithTag:1002]; secondLabel.text = @""; return cell; } In the screenshot below, such scrolling does not work, you can specify the Initial View Controller for the Navigator Controller and then the push will work, however you need the view controller connect to be the first screen loaded and that it is without navigation
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath { ViewControllerSecondTable *viewControllerSecondTable = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewControllerSecondTable"]; [self.navigationController pushViewController:viewControllerSecondTable animated:YES]; } 
