0

How to increase the UITableView custom cell height based on the webview content in objective c?

Flower * flower = [self.filteredflowers objectAtIndex: indexPath.row];
NSString * text = flower.descriptionText;
CGSize constraints = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 7), 20000.0 f);
CGSize size = [text SizeWithFont: [UIFont systemFontOfSize: FoONT_SIZE] constrainedToSize: constraints lineBrakeMode: UILineBreakModeWordwrap];

I wrote this code, but it's showing the sizewithfont and UILineBreakModeWordwrap method is deprecated in present xcode. I need replacement of this methods. Thank you.

ɢʀᴜɴᴛ
  • 32,025
  • 15
  • 116
  • 110
Raviteja
  • 1
  • 6
  • 2
    Welcome to SO. Please add a minimal code sample or image to illustrate the problem. Show us what you tried so far and what you expect from a working sample. – yacc Sep 03 '17 at 07:31
  • Flower *flower = [self.filteredflowers objectAtIndex:indexPath.row]; NSString *text = flower.descriptionText; CGSize constraints = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 7), 20000.0f); CGSize size = [text SizeWithFont:[UIFont systemFontOfSize:FoONT_SIZE] constrainedToSize: constraints lineBrakeMode:UILineBreakModeWordwrap]; I wrote this code, but its showing the "sizewithfont" and "UILineBreakModeWordwrap" method is deprecated in present xcode. I need replacement of this methods. Thank you. – Raviteja Sep 03 '17 at 07:33
  • A WebView content could not be stable, not even in time. So practically if you mean the height of WevView based on its content, then I don't think this makes sense. Apart from that I am sure you know that you can get the height of the WebView component, but probably this is not what you want. – Panayotis Sep 03 '17 at 07:46
  • See https://stackoverflow.com/questions/18897896/replacement-for-deprecated-sizewithfont-in-ios-7 – algrid Sep 03 '17 at 08:38

0 Answers0