From 15e13c8d452fdcb62c654f854eeb0f7d226a0a5b Mon Sep 17 00:00:00 2001 From: badeleux Date: Wed, 21 Aug 2013 17:34:23 +0200 Subject: [PATCH 1/4] barbutton support --- FPPopoverController.h | 4 + FPPopoverController.m | 18 +++ FPPopoverDemo.xcodeproj/project.pbxproj | 6 + FPPopoverDemo/FPViewController.m | 11 +- FPPopoverDemo/UIBarButtonItem+FPPopover.h | 15 ++ FPPopoverDemo/UIBarButtonItem+FPPopover.m | 29 ++++ .../en.lproj/FPViewController_iPhone.xib | 128 +----------------- 7 files changed, 85 insertions(+), 126 deletions(-) create mode 100644 FPPopoverDemo/UIBarButtonItem+FPPopover.h create mode 100644 FPPopoverDemo/UIBarButtonItem+FPPopover.m diff --git a/FPPopoverController.h b/FPPopoverController.h index f8aee39..68a76c7 100644 --- a/FPPopoverController.h +++ b/FPPopoverController.h @@ -67,6 +67,10 @@ /** @brief Presenting the popover from a specified point **/ -(void)presentPopoverFromPoint:(CGPoint)fromPoint; +/** @brief PResenting the popover from uibarbuttonitem **/ +- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem*)barButtonItem; + + /** @brief Dismiss the popover **/ -(void)dismissPopoverAnimated:(BOOL)animated; diff --git a/FPPopoverController.m b/FPPopoverController.m index 28406d4..2a70dbb 100644 --- a/FPPopoverController.m +++ b/FPPopoverController.m @@ -8,6 +8,7 @@ #import "FPPopoverController.h" +#import "UIBarButtonItem+FPPopover.h" //ivars @interface FPPopoverController() @@ -305,6 +306,12 @@ -(CGPoint)originFromView:(UIView*)fromView return p; } +- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem*)barButtonItem { + UIView *lastView = [self lastView]; + CGRect rect = [barButtonItem frameInView:lastView]; + [self presentPopoverFromPoint:CGPointMake(rect.origin.x + rect.size.width/2, rect.size.height + rect.origin.y)]; +} + -(void)presentPopoverFromView:(UIView*)fromView { SAFE_ARC_RELEASE(_fromView); @@ -603,6 +610,17 @@ -(void)setAlpha:(CGFloat)alpha self.view.alpha = alpha; } +#pragma mark - View Helpers + +- (UIView*)lastView { + UIWindow *w = [[UIApplication sharedApplication] keyWindow]; + if (w.subviews.count > 0) { + return [w.subviews objectAtIndex:0]; + } else { + return w; + } +} + diff --git a/FPPopoverDemo.xcodeproj/project.pbxproj b/FPPopoverDemo.xcodeproj/project.pbxproj index 2f2b7e0..cadfd5b 100644 --- a/FPPopoverDemo.xcodeproj/project.pbxproj +++ b/FPPopoverDemo.xcodeproj/project.pbxproj @@ -46,6 +46,7 @@ 18EF6DEB154ED27D005AB1DD /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 18EF6DE9154ED27D005AB1DD /* background.png */; }; 18EF6DEC154ED27D005AB1DD /* background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 18EF6DEA154ED27D005AB1DD /* background@2x.png */; }; 18F357271584E6E700AD4F07 /* FPDemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F357261584E6E700AD4F07 /* FPDemoTableViewController.m */; }; + EDF3CDC217C512FF000331D4 /* UIBarButtonItem+FPPopover.m in Sources */ = {isa = PBXBuildFile; fileRef = EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -105,6 +106,8 @@ 18EF6DEA154ED27D005AB1DD /* background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "background@2x.png"; sourceTree = ""; }; 18F357251584E6E700AD4F07 /* FPDemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FPDemoTableViewController.h; sourceTree = ""; }; 18F357261584E6E700AD4F07 /* FPDemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPDemoTableViewController.m; sourceTree = ""; }; + EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+FPPopover.h"; sourceTree = ""; }; + EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+FPPopover.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -219,6 +222,8 @@ 18EF6DD9154ECC72005AB1DD /* Resources */, 186C439F15386E2200502D64 /* DemoTableController.h */, 186C43A015386E2200502D64 /* DemoTableController.m */, + EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */, + EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */, ); path = FPPopoverDemo; sourceTree = ""; @@ -447,6 +452,7 @@ 186C43A115386E2200502D64 /* DemoTableController.m in Sources */, 18F357271584E6E700AD4F07 /* FPDemoTableViewController.m in Sources */, 18C427041764920D001D4A24 /* FPPopoverKeyboardResponsiveController.m in Sources */, + EDF3CDC217C512FF000331D4 /* UIBarButtonItem+FPPopover.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/FPPopoverDemo/FPViewController.m b/FPPopoverDemo/FPViewController.m index 8bbad1a..a2ef15f 100644 --- a/FPPopoverDemo/FPViewController.m +++ b/FPPopoverDemo/FPViewController.m @@ -11,6 +11,7 @@ #import "FPPopoverController.h" #import "FPDemoTableViewController.h" +#import "UIBarButtonItem+FPPopover.h" @interface FPViewController () @@ -24,7 +25,12 @@ @implementation FPViewController - (void)viewDidLoad { [super viewDidLoad]; - [self.navigationController setNavigationBarHidden:YES]; + [self.navigationController setNavigationBarHidden:NO]; + UIBarButtonItem *barButtonSample = [[UIBarButtonItem alloc]initWithTitle:@"BarButtonSample" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(popover:)]; + self.navigationItem.rightBarButtonItem = barButtonSample; //KEYBOARD OBSERVERS /************************/ @@ -93,6 +99,9 @@ -(IBAction)popover:(id)sender popover.arrowDirection = FPPopoverNoArrow; [popover presentPopoverFromPoint: CGPointMake(self.view.center.x, self.view.center.y - popover.contentSize.height/2)]; } + else if ([sender isKindOfClass:[UIBarButtonItem class]]) { + [popover presentPopoverFromBarButtonItem:sender]; + } else { //sender is the UIButton view popover.arrowDirection = FPPopoverArrowDirectionAny; diff --git a/FPPopoverDemo/UIBarButtonItem+FPPopover.h b/FPPopoverDemo/UIBarButtonItem+FPPopover.h new file mode 100644 index 0000000..313b444 --- /dev/null +++ b/FPPopoverDemo/UIBarButtonItem+FPPopover.h @@ -0,0 +1,15 @@ +// +// UIBarButtonItem+FPPopover.h +// FPPopoverDemo +// +// Created by Kamil Badyla on 21.08.2013. +// Copyright (c) 2013 Fifty Pixels Ltd. All rights reserved. +// + +#import + +@interface UIBarButtonItem (FPPopover) + +- (CGRect)frameInView:(UIView *)v; + +@end diff --git a/FPPopoverDemo/UIBarButtonItem+FPPopover.m b/FPPopoverDemo/UIBarButtonItem+FPPopover.m new file mode 100644 index 0000000..7718d17 --- /dev/null +++ b/FPPopoverDemo/UIBarButtonItem+FPPopover.m @@ -0,0 +1,29 @@ +// +// UIBarButtonItem+FPPopover.m +// FPPopoverDemo +// +// Created by Kamil Badyla on 21.08.2013. +// Copyright (c) 2013 Fifty Pixels Ltd. All rights reserved. +// + +#import "UIBarButtonItem+FPPopover.h" + +@implementation UIBarButtonItem (FPPopover) + +- (CGRect)frameInView:(UIView *)v { + + UIView *mainView = self.customView; + if (!mainView && [self respondsToSelector:@selector(view)]) { + mainView = [self performSelector:@selector(view)]; + } + NSUInteger indexOfView = [mainView.superview.subviews indexOfObject:mainView]; + if (mainView.superview.subviews.count > 0 && indexOfView != NSNotFound) { + UIView *button = [mainView.superview.subviews objectAtIndex:indexOfView]; + return [button convertRect:button.bounds toView:v]; + } + else { + return CGRectZero; + } +} + +@end diff --git a/FPPopoverDemo/en.lproj/FPViewController_iPhone.xib b/FPPopoverDemo/en.lproj/FPViewController_iPhone.xib index d6198de..deff874 100644 --- a/FPPopoverDemo/en.lproj/FPViewController_iPhone.xib +++ b/FPPopoverDemo/en.lproj/FPViewController_iPhone.xib @@ -2,9 +2,9 @@ 1552 - 12D78 + 12E55 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -42,7 +42,6 @@ 274 {320, 460} - _NS:9 NO @@ -57,7 +56,6 @@ 292 {{20, 20}, {71, 31}} - _NS:9 NO @@ -93,7 +91,6 @@ 293 {{123, 20}, {75, 31}} - _NS:9 NO @@ -116,7 +113,6 @@ 289 {{225, 20}, {75, 31}} - _NS:9 NO @@ -139,7 +135,6 @@ 257 {{222, 214}, {82, 31}} - _NS:9 NO @@ -162,7 +157,6 @@ 256 {{119, 214}, {82, 31}} - _NS:9 NO @@ -185,7 +179,6 @@ 260 {{20, 214}, {82, 31}} - _NS:9 NO @@ -208,7 +201,6 @@ 268 {{20, 409}, {82, 31}} - _NS:9 NO @@ -231,7 +223,6 @@ 264 {{114, 409}, {92, 31}} - _NS:9 NO @@ -254,8 +245,6 @@ 265 {{217, 409}, {92, 31}} - - _NS:9 NO IBCocoaTouchFramework @@ -277,7 +266,6 @@ 289 {{278, 114}, {44, 37}} - _NS:9 NO @@ -307,7 +295,6 @@ 292 {{0, 114}, {44, 37}} - _NS:9 NO @@ -330,7 +317,6 @@ 288 {{123, 114}, {74, 37}} - _NS:9 NO @@ -353,7 +339,6 @@ 292 {{198, 284}, {92, 44}} - _NS:9 NO @@ -376,7 +361,6 @@ 292 {{21, 284}, {123, 44}} - _NS:9 NO @@ -399,7 +383,6 @@ 288 {{50, 66}, {221, 30}} - _NS:9 NO @@ -435,7 +418,6 @@ {{0, 20}, {320, 460}} - 1 @@ -752,111 +734,7 @@ 48 - - - - FPViewController - UIViewController - - id - id - id - id - id - id - id - id - id - id - id - id - id - id - id - - - - bottomCenter: - id - - - bottomLeft: - id - - - bottomRight: - id - - - goToTableView: - id - - - lt: - id - - - midCenter: - id - - - midLeft: - id - - - midRight: - id - - - navControllerPopover: - id - - - noArrow: - id - - - popover: - id - - - rt: - id - - - topCenter: - id - - - topLeft: - id - - - topRight: - id - - - - UIButton - UIButton - - - - noArrow - UIButton - - - transparentPopover - UIButton - - - - IBProjectSource - ./Classes/FPViewController.h - - - - + 0 IBCocoaTouchFramework From 83065504e05ebec658158e6031e84eabf38d83cc Mon Sep 17 00:00:00 2001 From: badeleux Date: Wed, 21 Aug 2013 17:40:29 +0200 Subject: [PATCH 2/4] fix in pbxproj --- FPPopoverDemo.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FPPopoverDemo.xcodeproj/project.pbxproj b/FPPopoverDemo.xcodeproj/project.pbxproj index cadfd5b..342c49a 100644 --- a/FPPopoverDemo.xcodeproj/project.pbxproj +++ b/FPPopoverDemo.xcodeproj/project.pbxproj @@ -106,8 +106,8 @@ 18EF6DEA154ED27D005AB1DD /* background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "background@2x.png"; sourceTree = ""; }; 18F357251584E6E700AD4F07 /* FPDemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FPDemoTableViewController.h; sourceTree = ""; }; 18F357261584E6E700AD4F07 /* FPDemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPDemoTableViewController.m; sourceTree = ""; }; - EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+FPPopover.h"; sourceTree = ""; }; - EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+FPPopover.m"; sourceTree = ""; }; + EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIBarButtonItem+FPPopover.h"; path = "FPPopoverDemo/UIBarButtonItem+FPPopover.h"; sourceTree = ""; }; + EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIBarButtonItem+FPPopover.m"; path = "FPPopoverDemo/UIBarButtonItem+FPPopover.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -222,8 +222,6 @@ 18EF6DD9154ECC72005AB1DD /* Resources */, 186C439F15386E2200502D64 /* DemoTableController.h */, 186C43A015386E2200502D64 /* DemoTableController.m */, - EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */, - EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */, ); path = FPPopoverDemo; sourceTree = ""; @@ -249,6 +247,8 @@ 186C43971538513B00502D64 /* FPPopoverView.m */, 186C43AA153CAD1000502D64 /* FPTouchView.h */, 186C43AB153CAD1000502D64 /* FPTouchView.m */, + EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */, + EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */, ); name = FPPopover; sourceTree = ""; From 6aebab34276dcb23f02491dea8415d5070e671e4 Mon Sep 17 00:00:00 2001 From: badeleux Date: Wed, 21 Aug 2013 17:44:11 +0200 Subject: [PATCH 3/4] fix in structure of project --- FPPopoverDemo.xcodeproj/project.pbxproj | 12 ++++++------ ...onItem+FPPopover.h => UIBarButtonItem+FPPopover.h | 0 ...onItem+FPPopover.m => UIBarButtonItem+FPPopover.m | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename FPPopoverDemo/UIBarButtonItem+FPPopover.h => UIBarButtonItem+FPPopover.h (100%) rename FPPopoverDemo/UIBarButtonItem+FPPopover.m => UIBarButtonItem+FPPopover.m (100%) diff --git a/FPPopoverDemo.xcodeproj/project.pbxproj b/FPPopoverDemo.xcodeproj/project.pbxproj index 342c49a..958547f 100644 --- a/FPPopoverDemo.xcodeproj/project.pbxproj +++ b/FPPopoverDemo.xcodeproj/project.pbxproj @@ -46,7 +46,7 @@ 18EF6DEB154ED27D005AB1DD /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 18EF6DE9154ED27D005AB1DD /* background.png */; }; 18EF6DEC154ED27D005AB1DD /* background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 18EF6DEA154ED27D005AB1DD /* background@2x.png */; }; 18F357271584E6E700AD4F07 /* FPDemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F357261584E6E700AD4F07 /* FPDemoTableViewController.m */; }; - EDF3CDC217C512FF000331D4 /* UIBarButtonItem+FPPopover.m in Sources */ = {isa = PBXBuildFile; fileRef = EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */; }; + EDF3CDC517C517C7000331D4 /* UIBarButtonItem+FPPopover.m in Sources */ = {isa = PBXBuildFile; fileRef = EDF3CDC417C517C7000331D4 /* UIBarButtonItem+FPPopover.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -106,8 +106,8 @@ 18EF6DEA154ED27D005AB1DD /* background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "background@2x.png"; sourceTree = ""; }; 18F357251584E6E700AD4F07 /* FPDemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FPDemoTableViewController.h; sourceTree = ""; }; 18F357261584E6E700AD4F07 /* FPDemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPDemoTableViewController.m; sourceTree = ""; }; - EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIBarButtonItem+FPPopover.h"; path = "FPPopoverDemo/UIBarButtonItem+FPPopover.h"; sourceTree = ""; }; - EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIBarButtonItem+FPPopover.m"; path = "FPPopoverDemo/UIBarButtonItem+FPPopover.m"; sourceTree = ""; }; + EDF3CDC317C517C6000331D4 /* UIBarButtonItem+FPPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+FPPopover.h"; sourceTree = ""; }; + EDF3CDC417C517C7000331D4 /* UIBarButtonItem+FPPopover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+FPPopover.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -240,6 +240,8 @@ 186C43931538512A00502D64 /* FPPopover */ = { isa = PBXGroup; children = ( + EDF3CDC317C517C6000331D4 /* UIBarButtonItem+FPPopover.h */, + EDF3CDC417C517C7000331D4 /* UIBarButtonItem+FPPopover.m */, 18E1272F16D97A6500FB6CD0 /* ARCMacros.h */, 186C43941538513B00502D64 /* FPPopoverController.h */, 186C43951538513B00502D64 /* FPPopoverController.m */, @@ -247,8 +249,6 @@ 186C43971538513B00502D64 /* FPPopoverView.m */, 186C43AA153CAD1000502D64 /* FPTouchView.h */, 186C43AB153CAD1000502D64 /* FPTouchView.m */, - EDF3CDC017C512FF000331D4 /* UIBarButtonItem+FPPopover.h */, - EDF3CDC117C512FF000331D4 /* UIBarButtonItem+FPPopover.m */, ); name = FPPopover; sourceTree = ""; @@ -452,7 +452,7 @@ 186C43A115386E2200502D64 /* DemoTableController.m in Sources */, 18F357271584E6E700AD4F07 /* FPDemoTableViewController.m in Sources */, 18C427041764920D001D4A24 /* FPPopoverKeyboardResponsiveController.m in Sources */, - EDF3CDC217C512FF000331D4 /* UIBarButtonItem+FPPopover.m in Sources */, + EDF3CDC517C517C7000331D4 /* UIBarButtonItem+FPPopover.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/FPPopoverDemo/UIBarButtonItem+FPPopover.h b/UIBarButtonItem+FPPopover.h similarity index 100% rename from FPPopoverDemo/UIBarButtonItem+FPPopover.h rename to UIBarButtonItem+FPPopover.h diff --git a/FPPopoverDemo/UIBarButtonItem+FPPopover.m b/UIBarButtonItem+FPPopover.m similarity index 100% rename from FPPopoverDemo/UIBarButtonItem+FPPopover.m rename to UIBarButtonItem+FPPopover.m From a78f985ce5a315d90540a175012fdb1d7c14b7a5 Mon Sep 17 00:00:00 2001 From: badeleux Date: Wed, 21 Aug 2013 18:13:46 +0200 Subject: [PATCH 4/4] better viewDidAppear and viewWillAppear method forwarding --- FPPopoverController.m | 5 ++++- FPPopoverDemo/DemoTableController.m | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/FPPopoverController.m b/FPPopoverController.m index 2a70dbb..58a8edd 100644 --- a/FPPopoverController.m +++ b/FPPopoverController.m @@ -145,6 +145,8 @@ -(id)initWithViewController:(UIViewController*)viewController [_touchView addSubview:_contentView]; [_contentView addContentView:_viewController.view]; + [self addChildViewController:_viewController]; + _viewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view.clipsToBounds = NO; @@ -244,9 +246,10 @@ -(void)presentPopoverFromPoint:(CGPoint)fromPoint //keep the first subview if(_window.subviews.count > 0) { + [_viewController beginAppearanceTransition:YES animated:NO]; _parentView = [_window.subviews objectAtIndex:0]; [_parentView addSubview:self.view]; - [_viewController viewDidAppear:YES]; + [_viewController endAppearanceTransition]; } } diff --git a/FPPopoverDemo/DemoTableController.m b/FPPopoverDemo/DemoTableController.m index bd478a0..b7bee3f 100644 --- a/FPPopoverDemo/DemoTableController.m +++ b/FPPopoverDemo/DemoTableController.m @@ -23,6 +23,14 @@ - (void)viewDidLoad self.title = @"Popover Title"; } +- (void)viewWillAppear:(BOOL)animated { + +} + +- (void)viewDidAppear:(BOOL)animated { + +} + - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {