I have a simple flash card app I wrote for a friend of mine. I'm a hobby-est at best. It's essentially Tinder that you can flip the card over for a dead language. Everything has been working great up until the iOS 13 update with how Apple redid the Storyboards for flexibility.
My problem is my elegant solution to save userdefaults when exiting a view is no longer being called. This "carddeck" view controller is called when a button on another screen is pressed. To exit this same view controller before you would press a button that was tied to an "action segue - show" (not @IBAction) that would bring the view back to the "mainview" view controller. I tried the same action segue with "present modally." but no dice.
class CardDeckViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// called!
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
// called!
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(true)
// not called when "return" on this screen is pressed;
// however, it still returns to the main screen it just doesn't save the user's score
}
Any help would be appreciated. My hope is there is an easier fix than redoing the entire storyboard. I see about UIModalPresentFullScreen. I'm no Swift guru so at this point I thought I would reach out to the pros. Hopefully this is too time consuming of a fix. Luckily I think the other views are not affected by this other than one more.
Thanks for reading!