You can dismiss the current modal view controller any time you want. There is no 'correct way' of doing this. When the user selected a table view cell, you can dismiss the modal view controller in the UITableViewDelegate method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
/* dismiss your modal view controller
through the UIViewController method
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
or through the UINavigationViewController method
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
depending on the way you presented it in the first place. */
}
And a table view is your best choice for displaying options with long text.
You can adjust the height of each cell in the table view through the UITableViewDelegate method:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return /*appropriate cell height in order to accommodate long text */;
}
Also, if you'd like to calculate the height of any piece of text, you can do it like this:
// get the table view width
CGFloat tableViewWidth = [tableView bounds].size.width;
// get your piece of text
NSString *text = /*your text*/
CGFloat textHeight = [text sizeWithFont:[UIFont systemFontOfSize:18]/*or any font you want*/
forWidth:tableViewWidth
lineBreakMode:NSLineBreakByWordWrapping].height;