From 65e81f1cdee245451706098a2faf9f6096fb43fb Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 5 Mar 2013 17:41:29 +0100 Subject: [PATCH 1/6] display navBar optional --- TSMiniWebBrowser/TSMiniWebBrowser.h | 1 + TSMiniWebBrowser/TSMiniWebBrowser.m | 22 ++-- TSMiniWebBrowserDemo/ViewController.h | 3 +- TSMiniWebBrowserDemo/ViewController.m | 70 +++-------- .../en.lproj/ViewController.xib | 109 +++++++++++++++--- 5 files changed, 127 insertions(+), 78 deletions(-) diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.h b/TSMiniWebBrowser/TSMiniWebBrowser.h index 82d5a52..9e23b8e 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.h +++ b/TSMiniWebBrowser/TSMiniWebBrowser.h @@ -73,6 +73,7 @@ typedef enum { @property (nonatomic, assign) BOOL showPageTitleOnTitleBar; @property (nonatomic, assign) BOOL showReloadButton; @property (nonatomic, assign) BOOL showActionButton; +@property (nonatomic, assign) BOOL showNavigationBarInModalMode; // Only used in modal mode @property (nonatomic, assign) UIBarStyle barStyle; @property (nonatomic, strong) UIColor *barTintColor; @property (nonatomic, strong) NSString *modalDismissButtonTitle; diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.m b/TSMiniWebBrowser/TSMiniWebBrowser.m index 0c8a9f5..9dd1e97 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.m +++ b/TSMiniWebBrowser/TSMiniWebBrowser.m @@ -39,6 +39,7 @@ @implementation TSMiniWebBrowser @synthesize barTintColor; @synthesize domainLockList; @synthesize currentURL; +@synthesize showNavigationBarInModalMode; #define kToolBarHeight 44 #define kTabBarHeight 49 @@ -88,6 +89,10 @@ -(void) dismissController { } } +-(UIBarButtonItem *)doneButton{ + return [[UIBarButtonItem alloc] initWithTitle:modalDismissButtonTitle style:UIBarButtonItemStyleBordered target:self action:@selector(dismissController)]; +} + //Added in the dealloc method to remove the webview delegate, because if you use this in a navigation controller //TSMiniWebBrowser can get deallocated while the page is still loading and the web view will call its delegate-- resulting in a crash -(void)dealloc @@ -96,13 +101,10 @@ -(void)dealloc } #pragma mark - Init - // This method is only used in modal mode -(void) initTitleBar { - UIBarButtonItem *buttonDone = [[UIBarButtonItem alloc] initWithTitle:modalDismissButtonTitle style:UIBarButtonItemStyleBordered target:self action:@selector(dismissController)]; - UINavigationItem *titleBar = [[UINavigationItem alloc] initWithTitle:@""]; - titleBar.leftBarButtonItem = buttonDone; + titleBar.leftBarButtonItem = [self doneButton]; CGFloat width = self.view.frame.size.width; navigationBarModal = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, width, 44)]; @@ -167,6 +169,9 @@ -(void) initToolBar { [toolBarButtons addObject:fixedSpace2]; [toolBarButtons addObject:buttonAction]; } + if(showNavigationBarInModalMode == NO){ + [toolBarButtons addObject:[self doneButton]]; + } // Set buttons to tool bar [toolBar setItems:toolBarButtons animated:YES]; @@ -178,7 +183,9 @@ -(void) initToolBar { -(void) initWebView { CGSize viewSize = self.view.frame.size; if (mode == TSMiniWebBrowserModeModal) { - webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, kToolBarHeight, viewSize.width, viewSize.height-kToolBarHeight*2)]; + int webY = showNavigationBarInModalMode ? kToolBarHeight : 0; + int webHeight = showNavigationBarInModalMode ? kToolBarHeight*2 : kToolBarHeight*1; + webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, webY, viewSize.width, viewSize.height-webHeight)]; } else if(mode == TSMiniWebBrowserModeNavigation) { webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, viewSize.width, viewSize.height-kToolBarHeight)]; } else if(mode == TSMiniWebBrowserModeTabBar) { @@ -208,6 +215,7 @@ - (id)initWithUrl:(NSURL*)url { // Defaults mode = TSMiniWebBrowserModeNavigation; showURLStringOnActionSheetTitle = YES; + showNavigationBarInModalMode = YES; showPageTitleOnTitleBar = YES; showReloadButton = YES; showActionButton = YES; @@ -247,8 +255,8 @@ - (void)viewDidLoad // Init web view [self initWebView]; - // Init title bar if presented modally - if (mode == TSMiniWebBrowserModeModal) { + // Init title bar if presented modally and needed + if (mode == TSMiniWebBrowserModeModal && showNavigationBarInModalMode) { [self initTitleBar]; } diff --git a/TSMiniWebBrowserDemo/ViewController.h b/TSMiniWebBrowserDemo/ViewController.h index 647364e..4c2a25f 100644 --- a/TSMiniWebBrowserDemo/ViewController.h +++ b/TSMiniWebBrowserDemo/ViewController.h @@ -30,6 +30,7 @@ @interface ViewController : UIViewController { } -- (IBAction)buttonTouchUp:(id)sender; +- (IBAction)navigationTouchUp:(id)sender; +- (IBAction)modalTouchUp:(id)sender; @end diff --git a/TSMiniWebBrowserDemo/ViewController.m b/TSMiniWebBrowserDemo/ViewController.m index 81b4f2f..7d08175 100644 --- a/TSMiniWebBrowserDemo/ViewController.m +++ b/TSMiniWebBrowserDemo/ViewController.m @@ -28,46 +28,7 @@ @implementation ViewController -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; -} - -- (void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; -} -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; -} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -75,24 +36,31 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } -- (IBAction)buttonTouchUp:(id)sender { +- (IBAction)navigationTouchUp:(id)sender { TSMiniWebBrowser *webBrowser = [[TSMiniWebBrowser alloc] initWithUrl:[NSURL URLWithString:@"http://indiedevstories.com"]]; webBrowser.delegate = self; -// webBrowser.showURLStringOnActionSheetTitle = YES; -// webBrowser.showPageTitleOnTitleBar = YES; -// webBrowser.showActionButton = YES; -// webBrowser.showReloadButton = YES; -// [webBrowser setFixedTitleBarText:@"Test Title Text"]; // This has priority over "showPageTitleOnTitleBar". + // webBrowser.showURLStringOnActionSheetTitle = YES; + // webBrowser.showPageTitleOnTitleBar = YES; + // webBrowser.showActionButton = YES; + // webBrowser.showReloadButton = YES; + // [webBrowser setFixedTitleBarText:@"Test Title Text"]; // This has priority over "showPageTitleOnTitleBar". webBrowser.mode = TSMiniWebBrowserModeNavigation; webBrowser.barStyle = UIBarStyleBlack; - if (webBrowser.mode == TSMiniWebBrowserModeModal) { - webBrowser.modalDismissButtonTitle = @"Home"; - [self presentModalViewController:webBrowser animated:YES]; - } else if(webBrowser.mode == TSMiniWebBrowserModeNavigation) { - [self.navigationController pushViewController:webBrowser animated:YES]; - } + [self.navigationController pushViewController:webBrowser animated:YES]; +} + +- (IBAction)modalTouchUp:(id)sender { + TSMiniWebBrowser *webBrowser = [[TSMiniWebBrowser alloc] initWithUrl:[NSURL URLWithString:@"http://indiedevstories.com"]]; + webBrowser.delegate = self; + webBrowser.mode = TSMiniWebBrowserModeModal; + webBrowser.barStyle = UIBarStyleBlack; + webBrowser.showActionButton = YES; + //webBrowser.showNavigationBarInModalMode = NO; + + webBrowser.modalDismissButtonTitle = @"Close"; + [self presentModalViewController:webBrowser animated:YES]; } #pragma mark - TSMiniWebBrowserDelegate diff --git a/TSMiniWebBrowserDemo/en.lproj/ViewController.xib b/TSMiniWebBrowserDemo/en.lproj/ViewController.xib index cefd754..1756afb 100644 --- a/TSMiniWebBrowserDemo/en.lproj/ViewController.xib +++ b/TSMiniWebBrowserDemo/en.lproj/ViewController.xib @@ -1,19 +1,19 @@ - 1280 - 11C74 - 1938 - 1138.23 - 567.00 + 1536 + 12C2034 + 2844 + 1187.34 + 625.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 + 1930 IBProxyObject - IBUIView IBUIButton + IBUIView com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -38,17 +38,18 @@ 292 - {{77, 211}, {166, 37}} + {{77, 121}, {166, 44}} - + + _NS:225 NO IBCocoaTouchFramework 0 0 1 - TSMiniWebBrowser - + Mode Navigation + 3 MQA @@ -56,23 +57,47 @@ 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + 3 MC41AA - + 2 15 - + Helvetica-Bold 15 16 + + + 292 + {{77, 208}, {166, 44}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Modal + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + {{0, 20}, {320, 460}} + 3 @@ -98,12 +123,21 @@ - buttonTouchUp: + navigationTouchUp: 7 - 9 + 12 + + + + modalTouchUp: + + + 7 + + 13 @@ -130,6 +164,7 @@ + @@ -138,6 +173,11 @@ + + 10 + + + @@ -145,6 +185,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -152,13 +193,43 @@ - 9 + 13 + + + + + ViewController + UIViewController + + id + id + id + + + + buttonTouchUp: + id + + + modalTouchUp: + id + + + navigationTouchUp: + id + + + + IBProjectSource + ./Classes/ViewController.h + + + - 0 IBCocoaTouchFramework YES 3 - 933 + 1930 From 26efb82e2e9f41d339bd7069d90c575238997c47 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 5 Mar 2013 18:00:17 +0100 Subject: [PATCH 2/6] clean demo --- TSMiniWebBrowserDemo/ViewController.m | 7 ------- TSMiniWebBrowserDemo/en.lproj/ViewController.xib | 7 +------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/TSMiniWebBrowserDemo/ViewController.m b/TSMiniWebBrowserDemo/ViewController.m index 7d08175..f641a69 100644 --- a/TSMiniWebBrowserDemo/ViewController.m +++ b/TSMiniWebBrowserDemo/ViewController.m @@ -29,13 +29,6 @@ @implementation ViewController - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - // Return YES for supported orientations - return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); -} - - (IBAction)navigationTouchUp:(id)sender { TSMiniWebBrowser *webBrowser = [[TSMiniWebBrowser alloc] initWithUrl:[NSURL URLWithString:@"http://indiedevstories.com"]]; webBrowser.delegate = self; diff --git a/TSMiniWebBrowserDemo/en.lproj/ViewController.xib b/TSMiniWebBrowserDemo/en.lproj/ViewController.xib index 1756afb..90a4711 100644 --- a/TSMiniWebBrowserDemo/en.lproj/ViewController.xib +++ b/TSMiniWebBrowserDemo/en.lproj/ViewController.xib @@ -84,7 +84,7 @@ 0 0 1 - Modal + Mode Modal 1 @@ -201,15 +201,10 @@ ViewController UIViewController - id id id - - buttonTouchUp: - id - modalTouchUp: id From 774ce99c6d441b867898208fbb51fb32377dcd8f Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 5 Mar 2013 18:24:01 +0100 Subject: [PATCH 3/6] remove ARC --- TSMiniWebBrowser/TSMiniWebBrowser.h | 8 +++--- TSMiniWebBrowser/TSMiniWebBrowser.m | 27 +++++++++++-------- .../project.pbxproj | 2 ++ TSMiniWebBrowserDemo/ViewController.m | 2 ++ 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.h b/TSMiniWebBrowser/TSMiniWebBrowser.h index 9e23b8e..a43a402 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.h +++ b/TSMiniWebBrowser/TSMiniWebBrowser.h @@ -75,10 +75,10 @@ typedef enum { @property (nonatomic, assign) BOOL showActionButton; @property (nonatomic, assign) BOOL showNavigationBarInModalMode; // Only used in modal mode @property (nonatomic, assign) UIBarStyle barStyle; -@property (nonatomic, strong) UIColor *barTintColor; -@property (nonatomic, strong) NSString *modalDismissButtonTitle; -@property (nonatomic, strong) NSString *domainLockList; -@property (nonatomic, strong) NSString *currentURL; +@property (nonatomic, retain) UIColor *barTintColor; +@property (nonatomic, retain) NSString *modalDismissButtonTitle; +@property (nonatomic, retain) NSString *domainLockList; +@property (nonatomic, retain) NSString *currentURL; // Public Methods - (id)initWithUrl:(NSURL*)url; diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.m b/TSMiniWebBrowser/TSMiniWebBrowser.m index 9dd1e97..fc0454b 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.m +++ b/TSMiniWebBrowser/TSMiniWebBrowser.m @@ -90,7 +90,7 @@ -(void) dismissController { } -(UIBarButtonItem *)doneButton{ - return [[UIBarButtonItem alloc] initWithTitle:modalDismissButtonTitle style:UIBarButtonItemStyleBordered target:self action:@selector(dismissController)]; + return [[[UIBarButtonItem alloc] initWithTitle:modalDismissButtonTitle style:UIBarButtonItemStyleBordered target:self action:@selector(dismissController)] autorelease]; } //Added in the dealloc method to remove the webview delegate, because if you use this in a navigation controller @@ -98,12 +98,16 @@ -(UIBarButtonItem *)doneButton{ -(void)dealloc { [webView setDelegate:nil]; + [modalDismissButtonTitle release]; + [domainLockList release]; + [currentURL release]; + [super dealloc]; } #pragma mark - Init // This method is only used in modal mode -(void) initTitleBar { - UINavigationItem *titleBar = [[UINavigationItem alloc] initWithTitle:@""]; + UINavigationItem *titleBar = [[[UINavigationItem alloc] initWithTitle:@""] autorelease]; titleBar.leftBarButtonItem = [self doneButton]; CGFloat width = self.view.frame.size.width; @@ -134,29 +138,29 @@ -(void) initToolBar { buttonGoBack = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back_icon.png"] style:UIBarButtonItemStylePlain target:self action:@selector(backButtonTouchUp:)]; - UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; + UIBarButtonItem *fixedSpace = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil] autorelease]; fixedSpace.width = 30; buttonGoForward = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"forward_icon.png"] style:UIBarButtonItemStylePlain target:self action:@selector(forwardButtonTouchUp:)]; - UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; + UIBarButtonItem *flexibleSpace = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease]; - UIBarButtonItem *buttonReload = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reload_icon.png"] style:UIBarButtonItemStylePlain target:self action:@selector(reloadButtonTouchUp:)]; + UIBarButtonItem *buttonReload = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reload_icon.png"] style:UIBarButtonItemStylePlain target:self action:@selector(reloadButtonTouchUp:)] autorelease]; - UIBarButtonItem *fixedSpace2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; + UIBarButtonItem *fixedSpace2 = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil] autorelease]; fixedSpace2.width = 20; - UIBarButtonItem *buttonAction = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(buttonActionTouchUp:)]; + UIBarButtonItem *buttonAction = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(buttonActionTouchUp:)] autorelease]; // Activity indicator is a bit special activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; activityIndicator.frame = CGRectMake(11, 7, 20, 20); - UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 43, 33)]; + UIView *containerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 43, 33)] autorelease]; [containerView addSubview:activityIndicator]; - UIBarButtonItem *buttonContainer = [[UIBarButtonItem alloc] initWithCustomView:containerView]; + UIBarButtonItem *buttonContainer = [[[UIBarButtonItem alloc] initWithCustomView:containerView] autorelease]; // Add butons to an array - NSMutableArray *toolBarButtons = [[NSMutableArray alloc] init]; + NSMutableArray *toolBarButtons = [[[NSMutableArray alloc] init] autorelease]; [toolBarButtons addObject:buttonGoBack]; [toolBarButtons addObject:fixedSpace]; [toolBarButtons addObject:buttonGoForward]; @@ -358,7 +362,7 @@ - (void)showActionSheet { NSURL* url = [webView.request URL]; urlString = [url absoluteString]; } - UIActionSheet *actionSheet = [[UIActionSheet alloc] init]; + UIActionSheet *actionSheet = [[[UIActionSheet alloc] init] autorelease]; actionSheet.title = urlString; actionSheet.delegate = self; [actionSheet addButtonWithTitle:NSLocalizedString(@"Open in Safari", nil)]; @@ -552,6 +556,7 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK", nil), nil]; [alert show]; + [alert release]; } @end diff --git a/TSMiniWebBrowserDemo.xcodeproj/project.pbxproj b/TSMiniWebBrowserDemo.xcodeproj/project.pbxproj index e5707d8..251d9fd 100644 --- a/TSMiniWebBrowserDemo.xcodeproj/project.pbxproj +++ b/TSMiniWebBrowserDemo.xcodeproj/project.pbxproj @@ -318,6 +318,7 @@ 6F69CDCF14C6339C00BB6C57 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TSMiniWebBrowserDemo/TSMiniWebBrowserDemo-Prefix.pch"; INFOPLIST_FILE = "TSMiniWebBrowserDemo/TSMiniWebBrowserDemo-Info.plist"; @@ -330,6 +331,7 @@ 6F69CDD014C6339C00BB6C57 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TSMiniWebBrowserDemo/TSMiniWebBrowserDemo-Prefix.pch"; INFOPLIST_FILE = "TSMiniWebBrowserDemo/TSMiniWebBrowserDemo-Info.plist"; diff --git a/TSMiniWebBrowserDemo/ViewController.m b/TSMiniWebBrowserDemo/ViewController.m index f641a69..e321833 100644 --- a/TSMiniWebBrowserDemo/ViewController.m +++ b/TSMiniWebBrowserDemo/ViewController.m @@ -42,6 +42,7 @@ - (IBAction)navigationTouchUp:(id)sender { webBrowser.barStyle = UIBarStyleBlack; [self.navigationController pushViewController:webBrowser animated:YES]; + [webBrowser release]; } - (IBAction)modalTouchUp:(id)sender { @@ -54,6 +55,7 @@ - (IBAction)modalTouchUp:(id)sender { webBrowser.modalDismissButtonTitle = @"Close"; [self presentModalViewController:webBrowser animated:YES]; + [webBrowser release]; } #pragma mark - TSMiniWebBrowserDelegate From 6278c98838e557e261f69740e9c570295dd17b0f Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 5 Mar 2013 18:30:33 +0100 Subject: [PATCH 4/6] pull --- TSMiniWebBrowserDemo/ViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TSMiniWebBrowserDemo/ViewController.m b/TSMiniWebBrowserDemo/ViewController.m index e321833..ca50c02 100644 --- a/TSMiniWebBrowserDemo/ViewController.m +++ b/TSMiniWebBrowserDemo/ViewController.m @@ -51,7 +51,7 @@ - (IBAction)modalTouchUp:(id)sender { webBrowser.mode = TSMiniWebBrowserModeModal; webBrowser.barStyle = UIBarStyleBlack; webBrowser.showActionButton = YES; - //webBrowser.showNavigationBarInModalMode = NO; + //webBrowser.showNavigationBarInModalMode = NO; webBrowser.modalDismissButtonTitle = @"Close"; [self presentModalViewController:webBrowser animated:YES]; From f23f618e1d0d3fb14e0d9ee9778310de3da42d23 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 6 Mar 2013 09:07:41 +0100 Subject: [PATCH 5/6] youtube demo remove ARC --- .../EmbeddedYoutubePatch.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MoreDemos/EmbeddedYoutubePatch/EmbeddedYoutubePatch.xcodeproj/project.pbxproj b/MoreDemos/EmbeddedYoutubePatch/EmbeddedYoutubePatch.xcodeproj/project.pbxproj index e905f30..fc41ad4 100644 --- a/MoreDemos/EmbeddedYoutubePatch/EmbeddedYoutubePatch.xcodeproj/project.pbxproj +++ b/MoreDemos/EmbeddedYoutubePatch/EmbeddedYoutubePatch.xcodeproj/project.pbxproj @@ -287,6 +287,7 @@ 6FBF4B7D14F7EACF0048C98E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "EmbeddedYoutubePatch/EmbeddedYoutubePatch-Prefix.pch"; INFOPLIST_FILE = "EmbeddedYoutubePatch/EmbeddedYoutubePatch-Info.plist"; @@ -298,6 +299,7 @@ 6FBF4B7E14F7EACF0048C98E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "EmbeddedYoutubePatch/EmbeddedYoutubePatch-Prefix.pch"; INFOPLIST_FILE = "EmbeddedYoutubePatch/EmbeddedYoutubePatch-Info.plist"; @@ -325,6 +327,7 @@ 6FBF4B7E14F7EACF0048C98E /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; From 5849516a7af901efb5064b91ff60570ac74f8b07 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 6 Mar 2013 10:01:53 +0100 Subject: [PATCH 6/6] fix release --- TSMiniWebBrowser/TSMiniWebBrowser.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.m b/TSMiniWebBrowser/TSMiniWebBrowser.m index fc0454b..8904531 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.m +++ b/TSMiniWebBrowser/TSMiniWebBrowser.m @@ -313,7 +313,7 @@ -(void) viewWillDisappear:(BOOL)animated { - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations - return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); + return YES; } /* Fix for landscape + zooming webview bug. @@ -482,7 +482,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *) { if (navigationType == UIWebViewNavigationTypeLinkClicked) { - currentURL = request.URL.absoluteString; + self.currentURL = request.URL.absoluteString; } return YES; @@ -512,7 +512,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *) { if (navigationType == UIWebViewNavigationTypeLinkClicked) { - currentURL = request.URL.absoluteString; + self.currentURL = request.URL.absoluteString; } return YES;