pointfreeco / episode-code-samples

💾 Point-Free episode code.
https://www.pointfree.co
MIT License
939 stars 289 forks source link

Added this test to the .none case: if context.navigationController?.v… #107

Closed jharvey3 closed 2 years ago

jharvey3 commented 2 years ago

The main branch of episode 170 UIKit Navigation: Part 2 has a crash when you confirm a delete of an item in the inventory list. I think that is because this code:

if context.navigationController?.viewControllers.contains(vc) == true {
    context.navigationController?.popToViewController(vc, animated: true)
    context.navigationController?.popViewController(animated: true)
  } else {
    vc.dismiss(animated: true)
  }

That is discussed at 33:30 in the transcript of session 170, but not in the video (I don't think) is not included in the main branch. All I did was add the code from the transcript to the file.