Apple Watch pre-build action to change storyboard customModule references Apple Watch pre-build action to change storyboard customModule references xcode xcode

Apple Watch pre-build action to change storyboard customModule references


you should use add New Run Script Phase in your target's Build Phases, place it before the Compile Sources

Steps: (from Apple)

  1. In the project editor, select the target to which you want to add arun script build phase.
  2. Click Build Phases at the top of the project editor.
  3. Choose Editor > Add Build Phase > Add Run Script Build Phase.
  4. Disclose the Run Script section in the project editor.
  5. Configure the script in the Run Script template.


My solution is to go the Build settings of each watch extension target, setting the Product module name to the same value, for example, xxx_watch_extension. Then we should be able to choose this module for custom classes on the storyboard.

It works fine for me.