Design a Table View Screen with Navigation on Cell Button Tap
Requirements: Design and implement a screen with a table view (list), where each cell contains a button; tapping the button should open a new screen.
Design considerations: Cell-to-controller communication (since the button lives inside a reusable cell, not the view controller), correct index/row association when the button is tapped, and clean navigation handling.
Approach: Use a delegate/closure pattern on the custom cell class - the cell exposes a closure property (e.g., onButtonTap: (() -> Void)?) that the button's action triggers; when configuring the cell in cellForRowAt, the view controller sets this closure to capture the correct index path and perform the navigation (push/present the new view controller). Avoids fragile tag-based row lookups.