Is there a way to make UITableView cells in iOS 7 not have a line break in the separator?

For iOS7: if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { [self.tableView setSeparatorInset:UIEdgeInsetsZero]; } For iOS8: First configure your table view as follows: if ([self.tableView respondsToSelector:@selector(layoutMargins)]) { self.tableView.layoutMargins = UIEdgeInsetsZero; } Then in your cellForRowAtIndexPath: method, configure the cell as follows: if ([cell respondsToSelector:@selector(layoutMargins)]) { cell.layoutMargins = UIEdgeInsetsZero; } Note: Include both layoutMargins and separatorInset, to support both iOS versions

UITableView separator line disappears when selecting cells in iOS7

I haven’t gotten to the bottom of it yet (at first glance it seems like an iOS 7 bug..), but I have found a workaround. In tableView:didSelectRowAtIndexPath, if you send both messages below, the issue is visually resolved (with the probable performance cost). [tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; For this to work (for me), … Read more

UITableView is starting with an offset in iOS 7

The new iOS 7 implementation of UIViewController has a new set of options that allows the developer to choose if the system will automatically add insets for UIScrollView, UITableView and derivations. To disable this behaviour uncheck these boxes for all your wanted UIViewControllers in InterfaceBuilder, on UIViewController selected object inspector: For more details: Submit your … Read more

How to access the content of a custom cell in swift using button tag?

OPTION 1. Handling it with delegation The right way of handling events fired from your cell’s subviews is to use delegation. So you can follow the steps: 1. Above your class definition write a protocol with a single instance method inside your custom cell: protocol CustomCellDelegate { func cellButtonTapped(cell: CustomCell) } 2. Inside your class … Read more

iOS 7 – How to display a date picker in place in a table view?

With iOS7, Apple released the sample code DateCell. Demonstrates formatted display of date objects in table cells and use of UIDatePicker to edit those values. As a delegate to this table, the sample uses the method “didSelectRowAtIndexPath” to open the UIDatePicker control. For iOS 6.x and earlier, UIViewAnimation is used for sliding the UIDatePicker up … Read more

How to Implement Custom Table View Section Headers and Footers with Storyboard

Just use a prototype cell as your section header and / or footer. add an extra cell and put your desired elements in it. set the identifier to something specific (in my case SectionHeader) implement the tableView:viewForHeaderInSection: method or the tableView:viewForFooterInSection: method use [tableView dequeueReusableCellWithIdentifier:] to get the header implement the tableView:heightForHeaderInSection: method. -(UIView *) … Read more