Search code examples
iosswiftxcodeuikit

How do I remove something that is no longer in the program, that I dragged from the View Controller to a function?


I have dragged an element onto my code. How do I undo that? Here's an image:

enter image description here

The Green Slider is no longer on my storyboard and yet it appears in the round tab!

Here again:

enter image description here

Is there a way to get rid of "Main.storyboard – Green Slider"?


Solution

  • Click on the pop up, it will take you to storyboard. Remove its reference from there if it exists. I have attached an image for your help:

    enter image description here

    If reference doesn't exist then do 4 steps

    1. Close your project and close Xcode
    2. Open /Users/XXXXX/Library/Developer/Xcode/DerivedData and delete your cache of project
    3. Open /Users/ХХХХХ/Library/Developer/Xcode/DerivedData/ModuleCache.noindex and delete all cache from this directory
    4. Open your project again and click Product > Build

    If still exist do

    Just change one letter from name. This will cause it to break relationship to storyboard and link it again to new storyboard.