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

1

8

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.

Held answered 17/5, 2015 at 0:18 Comment(0)
K
31

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

Krefeld answered 17/5, 2015 at 0:26 Comment(1)
That was it - I had "Basic" selected for some reason. When I changed it to "Custom" the label went away on its own.Held

© 2022 - 2024 — McMap. All rights reserved.