1

I am using Xcode 7.3 for a project (minimum deployment target 8.0)

I have a storyboard that is growing in size. I thought of refactoring two (2) groups of scenes into Two (2) different storyboards using Editor -> Refactor To Storyboard... then creating two storyboards with different names to 'hold' the respective refactored scenes.

It worked as expected - two new storyboards (NewStoryBoard1 & NewStoryBoard2) that 'held' the two groups of refactored scenes.

When I build the project I get this error:

Deploying Storyboard References to iOS 8.0 requires that your storyboards do not share any view controller identifiers. NewStoryBoard1.storyboard and NewStoryBoard2.storyboard both contain a view controller with identifier "UIViewController-knd-7b-mzO".

I did not name the identifiers as

UIViewController-knd-7b-mzO

this seemingly was done automatically in Xcode.

My question is, why is Xcode creating two storyboard references to two different view controllers with the same identifiers?

I have a few similar Q&A threads that discuss this problem, but they have offered no solution.

How can I best fix this issue? Many thanks.

MORE INFO

After trying to refactor my selected scenes/views, I was presented with a new storyboard like this:

enter image description here

Zooming in:

enter image description here

An odd storyboard reference presented itself - despite the fact that I had already selected one ViewController on the new storyboard as my Initial ViewController.

I got the same type of storyboard reference in two of my new refactored storyboards. As a result, I received this error when I built the project:

Deploying Storyboard References to iOS 8.0 requires that your storyboards do not share any view controller identifiers. NewStoryBoard1.storyboard and NewStoryBoard2.storyboard both contain a view controller with identifier "UIViewController-knd-7b-mzO".

I tried renaming the new storyboard reference (listed as "Issue" in my diagram above) but that did not resolve the error.

Please see my answer below for how I resolved the issue.

1 Answers1

1

I think that I received the random UIViewController-knd-7b-mzO duplicate storyboard references that caused me my build error because:

Note: If a scene has an empty storyboard ID, the Refactor to Storyboard command automatically generates an ugly one, such as UIViewController-gtY-c7-gYu.

(source) https://www.raywenderlich.com/115697/ios-9-storyboards-tutorial-whats-new-in-storyboards

And I had not entered storyboard IDs for all my refactored scenes/views.

Moving on ... I managed to resolve the error issue by:

  1. Deleting the oddly-placed storyboard reference (listed in my above question as "Issue");
  2. Making sure that I had specified an Initial ViewController in each new storyboard; and
  3. Making sure the Reference ID field of both 'new storyboard' references in my Main (i.e. original) storyboard were blank.

enter image description here

In effect, this made sense. The reference directs any calls on the refactored storyboard scenes to the new storyboard (referenced by the Storyboard field) and thus automatically presenting the respective 'new' Initial ViewControllers.

Apologies for any errors in my syntax or code references, I am new to programming.

I do hope this helps anyone who may face the same issue in future.