2 // AboutViewController.m
5 // Created by Mike Mayo on 1/8/11.
6 // Copyright 2011 __MyCompanyName__. All rights reserved.
9 #import "AboutViewController.h"
10 #import "UIViewController+Conveniences.h"
12 @implementation AboutViewController
16 self.navigationItem.title = @"About";
18 // show the actual version of the app in the about screen
19 NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
20 NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"<version>" options:NSRegularExpressionCaseInsensitive error:nil];
21 NSRange range = [regex rangeOfFirstMatchInString:textView.text options:0 range:NSMakeRange(0, 100)];
22 if (!NSEqualRanges(range, NSMakeRange(NSNotFound, 0))) {
23 textView.text = [textView.text stringByReplacingCharactersInRange:range withString:version];
27 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
28 return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || (toInterfaceOrientation == UIInterfaceOrientationPortrait);