Skip to content

Commit

Permalink
Fixed bug with positioning when popover display area lies outside the…
Browse files Browse the repository at this point in the history
… view which was supplied to the presentPopover method
  • Loading branch information
werner77 committed May 8, 2011
1 parent 686f0d4 commit 0c8d321
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/WEPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ - (CGRect)displayAreaForView:(UIView *)theView {
if ([theView conformsToProtocol:@protocol(WEPopoverParentView)] && [theView respondsToSelector:@selector(displayAreaForPopover)]) {
displayArea = [(id <WEPopoverParentView>)theView displayAreaForPopover];
} else {
displayArea = theView.bounds;
displayArea = [[[UIApplication sharedApplication] keyWindow] convertRect:[[UIScreen mainScreen] applicationFrame] toView:theView];
}
return displayArea;
}
Expand Down
2 changes: 2 additions & 0 deletions Classes/WEPopoverTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "WEPopoverTableViewController.h"
#import "WEPopoverContentViewController.h"
#import "UIBarButtonItem+WEPopover.h"

@implementation WEPopoverTableViewController

Expand Down Expand Up @@ -206,6 +207,7 @@ - (IBAction)showPopover:(id)sender {
[self.popoverController presentPopoverFromBarButtonItem:sender
permittedArrowDirections:(UIPopoverArrowDirectionUp|UIPopoverArrowDirectionDown)
animated:YES];

[contentViewController release];
} else {
[self.popoverController dismissPopoverAnimated:YES];
Expand Down

0 comments on commit 0c8d321

Please sign in to comment.