What’s the best practice for naming Swift files that add extensions to existing objects?

It’s possible to add extensions to existing Swift object types using extensions, as described in the language specification. As a result, it’s possible to create extensions such as: extension String { var utf8data:NSData { return self.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! } } However, what’s the best naming practice for Swift source files containing such extensions? In the … Read more

How to add a right button to a UINavigationController?

I am trying to add a refresh button to the top bar of a navigation controller with no success. Here is the header: @interface PropertyViewController : UINavigationController { } Here is how I am trying to add it: – (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { UIBarButtonItem *anotherButton = [[UIBarButtonItem … Read more

iOS: Modal ViewController with transparent background

I’m trying to present a view controller modally, with a transparent background. My goal is to let both the presenting and presented view controllers’s view to be displayed at the same time. The problem is, when the presenting animation finishes, the presenting view controller’s view disappears. – (IBAction)pushModalViewControllerButtonPressed:(id)sender { ModalViewController *modalVC = [[ModalViewController alloc] init]; … Read more

Storyboard doesn’t contain a view controller with identifier

I keep getting the following error: Storyboard (<UIStoryboard: 0x7ebdd20>) doesn’t contain a view controller with identifier ‘drivingDetails’ This is the code: – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@”drivingDetails”]; controller.title = [[dao libraryItemAtIndex:indexPath.row] valueForKey:@”name”]; [self.navigationController pushViewController:controller animated:YES]; } I have already set the identifier on the UIStoryboard but I’m still getting this … Read more