Better approach for identic viewController in navigationController

Viewed 19

i have a question regarding navigation controller. for example i have a feature to show product detail that has a similar product. When user open the product detail, the screen will show similar product on the bottom of page and when the user click the similar product it will open new product detail again (and maybe has similar product too). And when user click back button on navigation bar it will move to previous product detail. in Summary the flow look like this.

Page landing (that embed navigationController) -> user click product -> Push ProductViewController to navigation stack -> user click similar data -> Push Again ProductViewController for the second time to navigation stack -> click back button -> pop to first ProductViewController.

when i look to memory leak tracker, it shows warning possible memory leak and maybe this issue is from duplicate viewController in the same navigationStack and it will increase memory for sure if user open 4 or 5 times with that flow. Is there any better approach for this case? Thank you.

0 Answers
Related