0
 override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    let secondVC = segue.destination as! SettingsViewController //error is marked here
    secondVC.transitioningDelegate = self
    secondVC.modalPresentationStyle = .custom
}

func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    transition.transitionMode = .present
    transition.startingPoint = settingsButton.center
    transition.circleColor = UIColor.white

    return transition
}

func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    transition.transitionMode = .dismiss
    transition.startingPoint = settingsButton.center
    transition.circleColor = UIColor.white

    return transition
}

I am following this tutorial to animate my Xcode application using Swift. I am running into the error of my SettingsViewController not being able to be cast as a UIViewController. I have checked out other questions with the same error but I have not found anything useful.

I am getting the error - SIGABRT: Could not cast value of type 'UIViewController' (0x7fff897a42b8) to 'Healthify.SettingsViewController' (0x107cd6a98)

Anyone know what I am doing wrong or experienced something similar?

Stryka
  • 39
  • 4
  • The exception says that you have an instance of `UIViewController` not `SettingsViewController`. Check the custom class for your scene in the storyboard. – Paulw11 May 12 '20 at 07:44

1 Answers1

0

I found the issue. I had embedded a UiViewController in the ViewController that was casting a UiViewController type to the SettingsViewController.

I did not need the UiViewController so I deleted it and the error went away.

Stryka
  • 39
  • 4