Search code examples
swiftuitableviewbuttoncell

Swift button not showing on tableviewcell when app is run


I have a quick simple question for you. I have a tableview and want to add a button(which is a star image) to every cell. Thus in the storyboard I drag a button into my tableview prototype cell. I can see perfectly that there is a button in the main.storyboard in my cell but, when I run the app no button is appearing in any tableview cell. How can I fix this issue? I'd appreciate any help!!


Solution

  • You need to create custom class for tableViewCell, and with this class, you can add your button. It's similar like in this tutorial, just instead of images, you can add buttons. On youtube you can find some good tutorial as well.