Search code examples
xcodexcode-storyboard

Why can't I delete labels from a table cell on storyboard?


I have a Storyboard-based application with a TableViewController. Inside the Content View for a particular cell, I have a textfield and a label. I added the label by accident and now I can't delete it. Hitting the delete key doesn't work and the "Delete" menu item is greyed out.

What's really bad about this is that Xcode complains about this label. But, when I try to fix the constraints for it, my project fails to compile. I really just want to delete the label as I don't need it.

fwiw this is what it looks like:

enter image description here

I'm in Xcode 6.2 and I'm using Swift for development.


Solution

  • You're probably using one of the built-in cell styles (like Subtitle), which has views you can't remove.

    Change your cell style to "Custom" and you'll be able to do whatever you want.

    enter image description here