-5

Hi what's the difference of using nib or storyboard on custom UITableViewCell? I'm planning to create Facebook News Feed using custom uitableviewcell with dynamic height.What's more flexible to use?

EDIT: Why did you down-vote my question? I don't see a problem on my post.

Ron Pelayo
  • 655
  • 2
  • 7
  • 22
  • 1
    You can use storyboard for any purpose. You can make a custom cell. And link with the custom class as well. – Prajeet Shrestha Dec 16 '14 at 06:34
  • @PrajeetShrestha Thanks for replying. I'll just ask if why is my Assistant Editor not automatically choosing My CustomTableViewCell header file? I've already linked my cell to my customcell class – Ron Pelayo Dec 16 '14 at 06:37
  • Same thing happens to me! Header is not selected automatically in assistant editor. May be xcode bug. – Prajeet Shrestha Dec 16 '14 at 06:42
  • Ok thanks for that I thought I'm the only one experiencing that issue – Ron Pelayo Dec 16 '14 at 06:45
  • I have seen this problem too. Try selecting your cell in the structure view on the left side of the storyboard, then I think the Assistant Editor will work correctly. – Mike Taverne Dec 16 '14 at 07:10
  • Select the Content View for your cell in the structure view on the left, and the Assistant Editor will offer your code file as one of the Automatic options. – Mike Taverne Dec 19 '14 at 03:19

2 Answers2

5

With nib you can design the custom cell only once for use in any number of classes, then you will only have to attach outlets with the nib; while with storyboard, for each screen you will have to make the custom cell and attach the outlets. So if the cell is required for only one screen , you may go for storyboard else use nib. Both ways you can have custom height

Amisha
  • 159
  • 1
  • 8
  • Thanks! How about for auto layout? Is it safe to use nib when my app supports landscape/portrait mode? – Ron Pelayo Dec 16 '14 at 06:39
  • @RonPelayo : Yes it is safe to use nib for apps working in both orientations...You will just have to set the frame of the nib in the awakeFromNib method depending on the device orientation. – Amisha Dec 16 '14 at 09:39
0

You can use nib or storyboard to define your custom uitableviewcell .You have to set identifier for uitableviewcell to access it in code. To create custom uitableviewcell with dynamic height:

UITableViewCell with dynamic height iOS

Community
  • 1
  • 1
Karan Dua
  • 2,401
  • 3
  • 15
  • 17