Skip to content

Instantly share code, notes, and snippets.

View PadraigK's full-sized avatar

Padraig PadraigK

View GitHub Profile
@PadraigK
PadraigK / Widon't
Last active August 29, 2015 13:57
Quick and dirty implementation of Shaun Inman's 'Widont' in Cocoa
// Example:
//
// Widont makes the last space non-breaking
// so you don't end up with one word on its
// own.
//
// Widont makes the last space non-breaking
// so you don't end up with one word on
// its own.
//
@PadraigK
PadraigK / gist:8481266
Created January 17, 2014 20:53
Your nightmare of double borders at the bottom of table views after selecting a cell is now over.
- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath
{
// Fix double cell border after highlight
if (indexPath.row == self.fetchedResultsController.fetchedObjects.count-1) {
UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:indexPath];
UIView *tableScrollView = [[cell subviews] lastObject];
UIView *separator = [[tableScrollView subviews] lastObject];
[separator setBackgroundColor:[UIColor clearColor]];