skip to Main Content

I’m trying to refactor one of my ViewControllers, by splitting it up.
This is for an app which will do card manipulations. I had a controller which could edit multiple types of shuffles but now I’m splitting it into separate controllers for each individual shuffle type.

There is another story board which allows you to pick moves, it is set up to have segues from hidden buttons. The segues point to storyboard references. Originally I made the scenes for the segues in the dispatch story board, and then refactored them using Xcode’s Editor>Refactor to Storyboard menu item.

I then made a new storyboard for the FaroEditor view controller. Then I tried to figure out how to add a reference to this storyboard. I finally found the ‘Storyboard reference’ in the object gallery.

I put this in the dispatch storyboard, and set it to point to the FaroEditor storyboard:

Storyboard

I did a bit of photoshopping to put the storyboard, the storyboard reference attributes, and the segue attributes in a single image.

When I run and trigger the segue, I get an exception thrown with no info as to what it is:

Backtrace

Again, I used photoshop to copy and paste the three top stack frames into a single image.

I’m at a bit of a loss about how to diagnose and fix this. Any ideas?

2

Answers


  1. You need to add a ‘storyboard ID’ on the view you are referencing and then add that same ID to the Referenced ID in the Attributes Inspector

    Login or Signup to reply.
  2. UI operations should be done in main thread

    DispatchQueue.main.async {
    self.performSegue(withIdentifier: "someSegue", sender: self)
    }
    

    Important
    Use UIKit classes only from your app’s main thread or main dispatch queue, unless otherwise indicated. This restriction particularly applies to classes derived from UIResponder or that involve manipulating your app’s user interface in any way.

    developer.apple.com/documentation/uikit

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search