diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a4e6ce --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Xcode +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside +.DS_Store diff --git a/Classes/Popover/UIBarButtonItem+WEPopover.h b/Classes/Popover/UIBarButtonItem+WEPopover.h index 4cf59bd..378231f 100644 --- a/Classes/Popover/UIBarButtonItem+WEPopover.h +++ b/Classes/Popover/UIBarButtonItem+WEPopover.h @@ -7,7 +7,6 @@ * */ -#import #import @interface UIBarButtonItem(WEPopover) diff --git a/Classes/Popover/WEPopover.h b/Classes/Popover/WEPopover.h new file mode 100644 index 0000000..6644593 --- /dev/null +++ b/Classes/Popover/WEPopover.h @@ -0,0 +1,6 @@ +#import +#import +#import +#import +#import +#import diff --git a/Classes/Popover/WEPopoverController.m b/Classes/Popover/WEPopoverController.m index dabcc1a..2e5be79 100755 --- a/Classes/Popover/WEPopoverController.m +++ b/Classes/Popover/WEPopoverController.m @@ -349,7 +349,6 @@ - (WEPopoverContainerViewProperties *)defaultContainerViewProperties { WEPopoverContainerViewProperties *ret = [[WEPopoverContainerViewProperties new] autorelease]; CGSize imageSize = CGSizeMake(30.0f, 30.0f); - NSString *bgImageName = @"popoverBgSimple.png"; CGFloat bgMargin = 6.0; CGFloat contentMargin = 2.0; @@ -359,17 +358,30 @@ - (WEPopoverContainerViewProperties *)defaultContainerViewProperties { ret.bottomBgMargin = bgMargin; ret.leftBgCapSize = imageSize.width/2; ret.topBgCapSize = imageSize.height/2; - ret.bgImageName = bgImageName; + ret.leftContentMargin = contentMargin; ret.rightContentMargin = contentMargin; ret.topContentMargin = contentMargin; ret.bottomContentMargin = contentMargin; ret.arrowMargin = 1.0; - ret.upArrowImageName = @"popoverArrowUpSimple.png"; - ret.downArrowImageName = @"popoverArrowDownSimple.png"; - ret.leftArrowImageName = @"popoverArrowLeftSimple.png"; - ret.rightArrowImageName = @"popoverArrowRightSimple.png"; + // Set the defaults images from framewor or from resources depending of the compilation type + ret.bgImageName = ([UIImage imageNamed:@"popoverBgSimple"] == nil) + ? @"WEPopover.framework/popoverBgSimple" + : @"popoverBgSimple"; + ret.upArrowImageName = ([UIImage imageNamed:@"popoverArrowUpSimple.png"] == nil) + ? @"WEPopover.framework/popoverArrowUpSimple.png" + : @"popoverArrowUpSimple.png"; + ret.downArrowImageName = ([UIImage imageNamed:@"popoverArrowDownSimple.png"] == nil) + ? @"WEPopover.framework/popoverArrowDownSimple.png" + : @"popoverArrowDownSimple.png"; + ret.leftArrowImageName = ([UIImage imageNamed:@"popoverArrowLeftSimple.png"] == nil) + ? @"WEPopover.framework/popoverArrowLeftSimple.png" + : @"popoverArrowLeftSimple.png"; + ret.rightArrowImageName = ([UIImage imageNamed:@"popoverArrowRightSimple.png"] == nil) + ? @"WEPopover.framework/popoverArrowRightSimple.png" + : @"popoverArrowRightSimple.png"; + return ret; } diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a83abe --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +About WEPopover +=============== + +WEPopover is an attempt to create a generalized version of the UIPopoverController which is unfortunately only available for the iPad. WEPopover should work on any device with iOS >= 3.2. If you want to use it with iOS < 3.2 you need to implement the @property(nonatomic, readwrite) CGSize contentSizeForViewInPopover for the content view controllers you want to present manually. + +The project contains some sample code illustrating the usage of the classes, but the only classes you actually need if you want to use the library reside in the "Popover" group in the project tree. + +Please have a look at the UIPopoverController documentation on details of the API. +Additions to the UIPopoverController API include: + +- Support for custom background views: specify the WEPopoverContainerViewProperties for the view to use as background. The properties specify the images to use for the stretchable background and the arrows (four directions). It also specifies the margins and the cap sizes for resizing the background. A default image with corresponding arrows are supplied with the project. +- Support for limiting the area to display the popover: implement the protocol WEPopoverParentView for the view you supply to the presentPopover method and implement the - (CGRect)displayAreaForPopover. +- Support for repositioning an existing popover (by passing the need to dismiss it and present a new one). See the 'repositionPopoverFromRect' method in WEPopoverController. + + +Integrate WEPopover in your project +=================================== + +The easiest way to integrate WEPopover in your project is build it as a framework. This option have many advantages over make it as subproject, especially if your project uses ARC. To Integrate it follow this easy steps: + +1 - Download the WEPopover source code from https://github.com/werner77/WEPopover/ + +2 - Select as active scheme "WEPopover Framework" for *iPhone/iPad simulator* and build it +![](https://raw.github.com/JoseExposito/WEPopover/WEPopover-as-Framework/screenshots/Integrate_WEPopover_1.png) + +3 - Go to the WEPopover source code folder, a "build" folder was generated with the "WEPopover.framework" in + +4 - In your project, go to your target and in "Build Phases" tab add the WEPopover.framework by pressing the "+" button, clicking in "Select others" and selecting the framework + +![](https://raw.github.com/JoseExposito/WEPopover/WEPopover-as-Framework/screenshots/Integrate_WEPopover_2.png) +![](https://raw.github.com/JoseExposito/WEPopover/WEPopover-as-Framework/screenshots/Integrate_WEPopover_3.png) + +5 - In the "Summary" tab, add the WEPopover.framework in the "Linked Frameworks and Libraries" section +![](https://raw.github.com/JoseExposito/WEPopover/WEPopover-as-Framework/screenshots/Integrate_WEPopover_4.png) diff --git a/WEPopover Framework Example/Classes/WEPopoverAppDelegate.h b/WEPopover Framework Example/Classes/WEPopoverAppDelegate.h new file mode 100755 index 0000000..46e41f1 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverAppDelegate.h @@ -0,0 +1,22 @@ +// +// WEPopoverAppDelegate.h +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import + +@class WEPopoverViewController; + +@interface WEPopoverAppDelegate : NSObject { + UIWindow *window; + UINavigationController *navController; +} + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet UINavigationController *navController; + +@end + diff --git a/WEPopover Framework Example/Classes/WEPopoverAppDelegate.m b/WEPopover Framework Example/Classes/WEPopoverAppDelegate.m new file mode 100755 index 0000000..0f9f440 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverAppDelegate.m @@ -0,0 +1,89 @@ +// +// WEPopoverAppDelegate.m +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import "WEPopoverAppDelegate.h" +#import "WEPopoverViewController.h" + +@implementation WEPopoverAppDelegate + +@synthesize window; +@synthesize navController; + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + NSLog(@"%@", [UIImage imageNamed:@"WEPopover.framework/popoverArrowDownSimple"]); + // Override point for customization after application launch. + + // Add the view controller's view to the window and display. + [window addSubview:navController.view]; + [window makeKeyAndVisible]; + + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ +} + + +- (void)dealloc { + [navController release]; + [window release]; + [super dealloc]; +} + + +@end diff --git a/WEPopover Framework Example/Classes/WEPopoverContentViewController.h b/WEPopover Framework Example/Classes/WEPopoverContentViewController.h new file mode 100755 index 0000000..6afbcf7 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverContentViewController.h @@ -0,0 +1,16 @@ +// +// WEPopoverContentViewController.h +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import + + +@interface WEPopoverContentViewController : UITableViewController { + +} + +@end diff --git a/WEPopover Framework Example/Classes/WEPopoverContentViewController.m b/WEPopover Framework Example/Classes/WEPopoverContentViewController.m new file mode 100755 index 0000000..f64829a --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverContentViewController.m @@ -0,0 +1,130 @@ +// +// WEPopoverContentViewController.m +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import "WEPopoverContentViewController.h" + + +@implementation WEPopoverContentViewController + + +#pragma mark - +#pragma mark Initialization + +- (id)initWithStyle:(UITableViewStyle)style { + // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. + if ((self = [super initWithStyle:style])) { + self.contentSizeForViewInPopover = CGSizeMake(100, 1 * 44 - 1); + } + return self; +} + +#pragma mark - +#pragma mark View lifecycle + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.tableView.rowHeight = 44.0; + self.view.backgroundColor = [UIColor clearColor]; + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +/* +- (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]; +} +*/ +/* +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} +*/ + + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + // Return the number of sections. + return 1; +} + + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + // Return the number of rows in the section. + return 1; +} + + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + } + + // Configure the cell... + cell.textLabel.text = [NSString stringWithFormat:@"Item %d", [indexPath row]]; + cell.textLabel.textColor = [UIColor whiteColor]; + return cell; +} + + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + // Navigation logic may go here. Create and push another view controller. + +} + + +#pragma mark - +#pragma mark Memory management + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Relinquish ownership any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand. + // For example: self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/WEPopover Framework Example/Classes/WEPopoverTableViewController.h b/WEPopover Framework Example/Classes/WEPopoverTableViewController.h new file mode 100755 index 0000000..abaf435 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverTableViewController.h @@ -0,0 +1,21 @@ +// +// WEPopoverTableViewController.h +// WEPopover +// +// Created by Werner Altewischer on 1/4/11. +// Copyright 2011 Werner IT Consultancy. All rights reserved. +// + +#import + +@interface WEPopoverTableViewController : UITableViewController { + WEPopoverController *popoverController; + NSInteger currentPopoverCellIndex; + Class popoverClass; +} + +@property (nonatomic, retain) WEPopoverController *popoverController; + +- (IBAction)showPopover:(id)sender; + +@end diff --git a/WEPopover Framework Example/Classes/WEPopoverTableViewController.m b/WEPopover Framework Example/Classes/WEPopoverTableViewController.m new file mode 100755 index 0000000..634a3c8 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverTableViewController.m @@ -0,0 +1,291 @@ +// +// WEPopoverTableViewController.m +// WEPopover +// +// Created by Werner Altewischer on 1/4/11. +// Copyright 2011 Werner IT Consultancy. All rights reserved. +// + +#import "WEPopoverTableViewController.h" +#import "WEPopoverContentViewController.h" + + +@implementation WEPopoverTableViewController + +@synthesize popoverController; + +#pragma mark - +#pragma mark Initialization + +/* +- (id)initWithStyle:(UITableViewStyle)style { + // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. + self = [super initWithStyle:style]; + if (self) { + // Custom initialization. + } + return self; +} +*/ + + +#pragma mark - +#pragma mark View lifecycle + +- (void)viewDidLoad { + [super viewDidLoad]; + + //Try setting this to UIPopoverController to use the iPad popover. The API is exactly the same! + popoverClass = [WEPopoverController class]; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + + currentPopoverCellIndex = -1; +} + +/* +- (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]; +} +*/ + +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations. + //return interfaceOrientation == UIInterfaceOrientationPortrait; + return YES; +} + + +- (void)viewDidUnload { + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; + [self.popoverController dismissPopoverAnimated:NO]; + self.popoverController = nil; + [super viewDidUnload]; +} + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + // Return the number of sections. + return 1; +} + + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + // Return the number of rows in the section. + return 100; +} + + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + } + + cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", indexPath.row]; + + return cell; +} + + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source. + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. + } +} +*/ + + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +/** + Thanks to Paul Solt for supplying these background images and container view properties + */ +- (WEPopoverContainerViewProperties *)improvedContainerViewProperties { + + WEPopoverContainerViewProperties *props = [[WEPopoverContainerViewProperties alloc] autorelease]; + NSString *bgImageName = nil; + CGFloat bgMargin = 0.0; + CGFloat bgCapSize = 0.0; + CGFloat contentMargin = 4.0; + + bgImageName = @"popoverBg.png"; + + // These constants are determined by the popoverBg.png image file and are image dependent + bgMargin = 13; // margin width of 13 pixels on all sides popoverBg.png (62 pixels wide - 36 pixel background) / 2 == 26 / 2 == 13 + bgCapSize = 31; // ImageSize/2 == 62 / 2 == 31 pixels + + props.leftBgMargin = bgMargin; + props.rightBgMargin = bgMargin; + props.topBgMargin = bgMargin; + props.bottomBgMargin = bgMargin; + props.leftBgCapSize = bgCapSize; + props.topBgCapSize = bgCapSize; + props.bgImageName = bgImageName; + props.leftContentMargin = contentMargin; + props.rightContentMargin = contentMargin - 1; // Need to shift one pixel for border to look correct + props.topContentMargin = contentMargin; + props.bottomContentMargin = contentMargin; + + props.arrowMargin = 4.0; + + props.upArrowImageName = @"popoverArrowUp.png"; + props.downArrowImageName = @"popoverArrowDown.png"; + props.leftArrowImageName = @"popoverArrowLeft.png"; + props.rightArrowImageName = @"popoverArrowRight.png"; + return props; +} + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + // Navigation logic may go here. Create and push another view controller. + BOOL shouldShowNewPopover = indexPath.row != currentPopoverCellIndex; + + if (self.popoverController) { + [self.popoverController dismissPopoverAnimated:YES]; + self.popoverController = nil; + currentPopoverCellIndex = -1; + } + + if (shouldShowNewPopover) { + UIViewController *contentViewController = [[WEPopoverContentViewController alloc] initWithStyle:UITableViewStylePlain]; + CGRect frame = [tableView cellForRowAtIndexPath:indexPath].frame; + //double percentage = (rand() / ((double)RAND_MAX)); + //double percentage = 0.95; + //CGRect rect = CGRectMake(frame.size.width * percentage, frame.origin.y, 1, frame.size.height); + CGRect rect = frame; + + self.popoverController = [[[popoverClass alloc] initWithContentViewController:contentViewController] autorelease]; + + if ([self.popoverController respondsToSelector:@selector(setContainerViewProperties:)]) { + [self.popoverController setContainerViewProperties:[self improvedContainerViewProperties]]; + } + + self.popoverController.delegate = self; + + //Uncomment the line below to allow the table view to handle events while the popover is displayed. + //Otherwise the popover is dismissed automatically if a user touches anywhere outside of its view. + + self.popoverController.passthroughViews = [NSArray arrayWithObject:self.tableView]; + + [self.popoverController presentPopoverFromRect:rect + inView:self.view + permittedArrowDirections:(UIPopoverArrowDirectionUp|UIPopoverArrowDirectionDown| + UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionRight) + animated:YES]; + currentPopoverCellIndex = indexPath.row; + + [contentViewController release]; + } + +} + +#pragma mark - +#pragma mark Actions + +- (IBAction)showPopover:(id)sender { + + if (!self.popoverController) { + + UIViewController *contentViewController = [[WEPopoverContentViewController alloc] initWithStyle:UITableViewStylePlain]; + self.popoverController = [[[popoverClass alloc] initWithContentViewController:contentViewController] autorelease]; + self.popoverController.delegate = self; + self.popoverController.passthroughViews = [NSArray arrayWithObject:self.navigationController.navigationBar]; + + [self.popoverController presentPopoverFromBarButtonItem:sender + permittedArrowDirections:(UIPopoverArrowDirectionUp|UIPopoverArrowDirectionDown) + animated:YES]; + + [contentViewController release]; + } else { + [self.popoverController dismissPopoverAnimated:YES]; + self.popoverController = nil; + } +} + +#pragma mark - +#pragma mark WEPopoverControllerDelegate implementation + +- (void)popoverControllerDidDismissPopover:(WEPopoverController *)thePopoverController { + //Safe to release the popover here + self.popoverController = nil; +} + +- (BOOL)popoverControllerShouldDismissPopover:(WEPopoverController *)thePopoverController { + //The popover is automatically dismissed if you click outside it, unless you return NO here + return YES; +} + + +#pragma mark - +#pragma mark Memory management + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Relinquish ownership any cached data, images, etc. that aren't in use. +} + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/WEPopover Framework Example/Classes/WEPopoverViewController.h b/WEPopover Framework Example/Classes/WEPopoverViewController.h new file mode 100755 index 0000000..5061d95 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverViewController.h @@ -0,0 +1,22 @@ +// +// WEPopoverViewController.h +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import + +@class WEPopoverController; + +@interface WEPopoverViewController : UIViewController { + WEPopoverController *popoverController; +} + +@property (nonatomic, retain) WEPopoverController *popoverController; + +- (IBAction)onButtonClick:(UIButton *)button; + +@end + diff --git a/WEPopover Framework Example/Classes/WEPopoverViewController.m b/WEPopover Framework Example/Classes/WEPopoverViewController.m new file mode 100755 index 0000000..2056df3 --- /dev/null +++ b/WEPopover Framework Example/Classes/WEPopoverViewController.m @@ -0,0 +1,87 @@ +// +// WEPopoverViewController.m +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import "WEPopoverViewController.h" +#import "WEPopoverContentViewController.h" + +@implementation WEPopoverViewController + +@synthesize popoverController; + +/* +// The designated initializer. Override to perform setup that is required before the view is loaded. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + // Custom initialization + } + return self; +} +*/ + +/* +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView { +} +*/ + + +/* +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; +} +*/ + + +/* +// Override to allow orientations other than the default portrait orientation. +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} +*/ + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; + [self.popoverController dismissPopoverAnimated:NO]; + self.popoverController = nil; +} + +- (IBAction)onButtonClick:(UIButton *)button { + + if (self.popoverController) { + [self.popoverController dismissPopoverAnimated:YES]; + self.popoverController = nil; + [button setTitle:@"Show Popover" forState:UIControlStateNormal]; + } else { + UIViewController *contentViewController = [[WEPopoverContentViewController alloc] initWithStyle:UITableViewStylePlain]; + + self.popoverController = [[[WEPopoverController alloc] initWithContentViewController:contentViewController] autorelease]; + [self.popoverController presentPopoverFromRect:button.frame + inView:self.view + permittedArrowDirections:UIPopoverArrowDirectionDown + animated:YES]; + [contentViewController release]; + [button setTitle:@"Hide Popover" forState:UIControlStateNormal]; + } +} + +- (void)dealloc { + [self viewDidUnload]; + [super dealloc]; +} + +@end diff --git a/WEPopover Framework Example/LICENSE b/WEPopover Framework Example/LICENSE new file mode 100755 index 0000000..163d133 --- /dev/null +++ b/WEPopover Framework Example/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Werner IT Consultancy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/WEPopover Framework Example/MainWindow.xib b/WEPopover Framework Example/MainWindow.xib new file mode 100755 index 0000000..47d8ac9 --- /dev/null +++ b/WEPopover Framework Example/MainWindow.xib @@ -0,0 +1,601 @@ + + + + 1056 + 10J869 + 823 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 132 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBIPadFramework + + + IBFirstResponder + IBIPadFramework + + + IBIPadFramework + + + + 292 + {768, 1004} + + 1 + MSAxIDEAA + + NO + NO + + 2 + + IBIPadFramework + YES + + + + + 1 + + IBIPadFramework + NO + + + 256 + {0, 0} + NO + YES + YES + IBIPadFramework + + + YES + + NO + + + Item + + Show Popover + IBIPadFramework + 1 + + + IBIPadFramework + + + + + 1 + + IBIPadFramework + NO + + + + + + + YES + + + delegate + + + + 4 + + + + window + + + + 14 + + + + navController + + + + 22 + + + + showPopover: + + + + 23 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + 3 + + + WEPopover App Delegate + + + -2 + + + + + 12 + + + + + 16 + + + YES + + + + + + + 18 + + + + + 10 + + + YES + + + + + + 20 + + + YES + + + + + + 21 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 10.CustomClassName + 10.IBEditorWindowLastContentRect + 10.IBLastUsedUIStatusBarStylesToTargetRuntimesMap + 10.IBPluginDependency + 12.IBEditorWindowLastContentRect + 12.IBLastUsedUIStatusBarStylesToTargetRuntimesMap + 12.IBPluginDependency + 16.IBEditorWindowLastContentRect + 16.IBLastUsedUIStatusBarStylesToTargetRuntimesMap + 16.IBPluginDependency + 18.IBPluginDependency + 21.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + + + YES + UIApplication + UIResponder + WEPopoverTableViewController + {{418, 454}, {320, 480}} + + IBCocoaTouchFramework + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{525, 346}, {320, 480}} + + IBCocoaTouchFramework + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{434, -54}, {768, 1024}} + + IBCocoaTouchFramework + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + WEPopoverAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 23 + + + + YES + + UIBarButtonItem + + IBProjectSource + Classes/UIBarButtonItem+WEPopover.h + + + + UIWindow + UIView + + IBUserSource + + + + + WEPopoverAppDelegate + NSObject + + YES + + YES + navController + window + + + YES + UINavigationController + UIWindow + + + + YES + + YES + navController + window + + + YES + + navController + UINavigationController + + + window + UIWindow + + + + + IBProjectSource + Classes/WEPopoverAppDelegate.h + + + + WEPopoverTableViewController + UITableViewController + + showPopover: + id + + + showPopover: + + showPopover: + id + + + + IBProjectSource + Classes/WEPopoverTableViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIApplication + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIApplication.h + + + + UIBarButtonItem + UIBarItem + + IBFrameworkSource + UIKit.framework/Headers/UIBarButtonItem.h + + + + UIBarItem + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIBarItem.h + + + + UINavigationBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UINavigationBar.h + + + + UINavigationController + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UINavigationItem + NSObject + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UITableViewController + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITableViewController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIPrintFormatter.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + UIWindow + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIWindow.h + + + + + 0 + IBIPadFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + WEPopover.xcodeproj + 3 + 132 + + diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowDown.png b/WEPopover Framework Example/Personalized Popover/popoverArrowDown.png new file mode 100755 index 0000000..b632256 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowDown.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowDown@2x.png b/WEPopover Framework Example/Personalized Popover/popoverArrowDown@2x.png new file mode 100755 index 0000000..8b79116 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowDown@2x.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowLeft.png b/WEPopover Framework Example/Personalized Popover/popoverArrowLeft.png new file mode 100755 index 0000000..d55ef2b Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowLeft.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowLeft@2x.png b/WEPopover Framework Example/Personalized Popover/popoverArrowLeft@2x.png new file mode 100755 index 0000000..f9d055a Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowLeft@2x.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowRight.png b/WEPopover Framework Example/Personalized Popover/popoverArrowRight.png new file mode 100755 index 0000000..f549522 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowRight.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowRight@2x.png b/WEPopover Framework Example/Personalized Popover/popoverArrowRight@2x.png new file mode 100755 index 0000000..84af6f5 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowRight@2x.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowUp.png b/WEPopover Framework Example/Personalized Popover/popoverArrowUp.png new file mode 100755 index 0000000..14adae0 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowUp.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverArrowUp@2x.png b/WEPopover Framework Example/Personalized Popover/popoverArrowUp@2x.png new file mode 100755 index 0000000..40428f5 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverArrowUp@2x.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverBg.png b/WEPopover Framework Example/Personalized Popover/popoverBg.png new file mode 100755 index 0000000..8fb6754 Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverBg.png differ diff --git a/WEPopover Framework Example/Personalized Popover/popoverBg@2x.png b/WEPopover Framework Example/Personalized Popover/popoverBg@2x.png new file mode 100755 index 0000000..e1e575b Binary files /dev/null and b/WEPopover Framework Example/Personalized Popover/popoverBg@2x.png differ diff --git a/README b/WEPopover Framework Example/README old mode 100644 new mode 100755 similarity index 100% rename from README rename to WEPopover Framework Example/README diff --git a/WEPopover Framework Example/WEPopover-Info.plist b/WEPopover Framework Example/WEPopover-Info.plist new file mode 100755 index 0000000..4c626b4 --- /dev/null +++ b/WEPopover Framework Example/WEPopover-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + + diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/UIBarButtonItem+WEPopover.h b/WEPopover Framework Example/WEPopover.framework/Headers/UIBarButtonItem+WEPopover.h new file mode 100644 index 0000000..378231f --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/UIBarButtonItem+WEPopover.h @@ -0,0 +1,17 @@ +/* + * UIBarButtonItem+WEPopover.h + * WEPopover + * + * Created by Werner Altewischer on 07/05/11. + * Copyright 2010 Werner IT Consultancy. All rights reserved. + * + */ + +#import + +@interface UIBarButtonItem(WEPopover) + +- (CGRect)frameInView:(UIView *)v; +- (UIView *)superview; + +@end diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/WEPopover.h b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopover.h new file mode 100644 index 0000000..6644593 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopover.h @@ -0,0 +1,6 @@ +#import +#import +#import +#import +#import +#import diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverContainerView.h b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverContainerView.h new file mode 100755 index 0000000..f974aac --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverContainerView.h @@ -0,0 +1,99 @@ +// +// WEPopoverContainerView.h +// WEPopover +// +// Created by Werner Altewischer on 02/09/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import +#import + +/** + * @brief Properties for the container view determining the area where the actual content view can/may be displayed. Also Images can be supplied for the arrow images and background. + */ +@interface WEPopoverContainerViewProperties : NSObject +{ + NSString *bgImageName; + NSString *upArrowImageName; + NSString *downArrowImageName; + NSString *leftArrowImageName; + NSString *rightArrowImageName; + CGFloat leftBgMargin; + CGFloat rightBgMargin; + CGFloat topBgMargin; + CGFloat bottomBgMargin; + NSInteger topBgCapSize; + NSInteger leftBgCapSize; + CGFloat arrowMargin; +} + +@property(nonatomic, retain) NSString *bgImageName; +@property(nonatomic, retain) NSString *upArrowImageName; +@property(nonatomic, retain) NSString *downArrowImageName; +@property(nonatomic, retain) NSString *leftArrowImageName; +@property(nonatomic, retain) NSString *rightArrowImageName; +@property(nonatomic, assign) CGFloat leftBgMargin; +@property(nonatomic, assign) CGFloat rightBgMargin; +@property(nonatomic, assign) CGFloat topBgMargin; +@property(nonatomic, assign) CGFloat bottomBgMargin; +@property(nonatomic, assign) CGFloat leftContentMargin; +@property(nonatomic, assign) CGFloat rightContentMargin; +@property(nonatomic, assign) CGFloat topContentMargin; +@property(nonatomic, assign) CGFloat bottomContentMargin; +@property(nonatomic, assign) NSInteger topBgCapSize; +@property(nonatomic, assign) NSInteger leftBgCapSize; +@property(nonatomic, assign) CGFloat arrowMargin; + +@end + +@class WEPopoverContainerView; + +/** + * @brief Container/background view for displaying a popover view. + */ +@interface WEPopoverContainerView : UIView { + UIImage *bgImage; + UIImage *arrowImage; + + WEPopoverContainerViewProperties *properties; + + UIPopoverArrowDirection arrowDirection; + + CGRect arrowRect; + CGRect bgRect; + CGPoint offset; + CGPoint arrowOffset; + + CGSize correctedSize; + UIView *contentView; +} + +/** + * @brief The current arrow direction for the popover. + */ +@property (nonatomic, readonly) UIPopoverArrowDirection arrowDirection; + +/** + * @brief The content view being displayed. + */ +@property (nonatomic, retain) UIView *contentView; + +/** + * @brief Initializes the position of the popover with a size, anchor rect, display area and permitted arrow directions and optionally the properties. + * If the last is not supplied the defaults are taken (requires images to be present in bundle representing a black rounded background with partial transparency). + */ +- (id)initWithSize:(CGSize)theSize + anchorRect:(CGRect)anchorRect + displayArea:(CGRect)displayArea +permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections + properties:(WEPopoverContainerViewProperties *)properties; + +/** + * @brief To update the position of the popover with a new anchor rect, display area and permitted arrow directions + */ +- (void)updatePositionWithAnchorRect:(CGRect)anchorRect + displayArea:(CGRect)displayArea + permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections; + +@end diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverController.h b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverController.h new file mode 100755 index 0000000..324c869 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverController.h @@ -0,0 +1,67 @@ +// +// WEPopoverController.h +// WEPopover +// +// Created by Werner Altewischer on 02/09/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import +#import "WEPopoverContainerView.h" +#import "WETouchableView.h" + +@class WEPopoverController; + +@protocol WEPopoverControllerDelegate + +- (void)popoverControllerDidDismissPopover:(WEPopoverController *)popoverController; +- (BOOL)popoverControllerShouldDismissPopover:(WEPopoverController *)popoverController; + +@end + +/** + * @brief Popover controller for the iPhone, mimicing the iPad UIPopoverController interface. See that class for more details. + */ +@interface WEPopoverController : NSObject { + UIViewController *contentViewController; + UIView *view; + WETouchableView *backgroundView; + + BOOL popoverVisible; + UIPopoverArrowDirection popoverArrowDirection; + id delegate; + CGSize popoverContentSize; + WEPopoverContainerViewProperties *containerViewProperties; + id context; + NSArray *passthroughViews; +} + +@property(nonatomic, retain) UIViewController *contentViewController; + +@property (nonatomic, readonly) UIView *view; +@property (nonatomic, readonly, getter=isPopoverVisible) BOOL popoverVisible; +@property (nonatomic, readonly) UIPopoverArrowDirection popoverArrowDirection; +@property (nonatomic, assign) id delegate; +@property (nonatomic, assign) CGSize popoverContentSize; +@property (nonatomic, retain) WEPopoverContainerViewProperties *containerViewProperties; +@property (nonatomic, retain) id context; +@property (nonatomic, copy) NSArray *passthroughViews; + +- (id)initWithContentViewController:(UIViewController *)theContentViewController; + +- (void)dismissPopoverAnimated:(BOOL)animated; + +- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item + permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections + animated:(BOOL)animated; + +- (void)presentPopoverFromRect:(CGRect)rect + inView:(UIView *)view + permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections + animated:(BOOL)animated; + +- (void)repositionPopoverFromRect:(CGRect)rect + inView:(UIView *)view + permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections; + +@end diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverParentView.h b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverParentView.h new file mode 100755 index 0000000..111f8fa --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/WEPopoverParentView.h @@ -0,0 +1,15 @@ +/* + * WEPopoverParentView.h + * WEPopover + * + * Created by Werner Altewischer on 02/09/10. + * Copyright 2010 Werner IT Consultancy. All rights reserved. + * + */ + +@protocol WEPopoverParentView + +@optional +- (CGRect)displayAreaForPopover; + +@end \ No newline at end of file diff --git a/WEPopover Framework Example/WEPopover.framework/Headers/WETouchableView.h b/WEPopover Framework Example/WEPopover.framework/Headers/WETouchableView.h new file mode 100644 index 0000000..5210205 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.framework/Headers/WETouchableView.h @@ -0,0 +1,37 @@ +// +// WETouchableView.h +// WEPopover +// +// Created by Werner Altewischer on 12/21/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import +#import + +@class WETouchableView; + +/** + * @brief delegate to receive touch events + */ +@protocol WETouchableViewDelegate + +- (void)viewWasTouched:(WETouchableView *)view; + +@end + +/** + * @brief View that can handle touch events and/or disable touch forwording to child views + */ +@interface WETouchableView : UIView { + BOOL touchForwardingDisabled; + id delegate; + NSArray *passthroughViews; + BOOL testHits; +} + +@property (nonatomic, assign) BOOL touchForwardingDisabled; +@property (nonatomic, assign) id delegate; +@property (nonatomic, copy) NSArray *passthroughViews; + +@end diff --git a/WEPopover Framework Example/WEPopover.framework/WEPopover b/WEPopover Framework Example/WEPopover.framework/WEPopover new file mode 100644 index 0000000..c47791c Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/WEPopover differ diff --git a/WEPopover Framework Example/WEPopover.framework/popoverArrowDownSimple.png b/WEPopover Framework Example/WEPopover.framework/popoverArrowDownSimple.png new file mode 100755 index 0000000..ddae902 Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/popoverArrowDownSimple.png differ diff --git a/WEPopover Framework Example/WEPopover.framework/popoverArrowLeftSimple.png b/WEPopover Framework Example/WEPopover.framework/popoverArrowLeftSimple.png new file mode 100755 index 0000000..adc4a8a Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/popoverArrowLeftSimple.png differ diff --git a/WEPopover Framework Example/WEPopover.framework/popoverArrowRightSimple.png b/WEPopover Framework Example/WEPopover.framework/popoverArrowRightSimple.png new file mode 100755 index 0000000..b3ebfe3 Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/popoverArrowRightSimple.png differ diff --git a/WEPopover Framework Example/WEPopover.framework/popoverArrowUpSimple.png b/WEPopover Framework Example/WEPopover.framework/popoverArrowUpSimple.png new file mode 100755 index 0000000..099d54f Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/popoverArrowUpSimple.png differ diff --git a/WEPopover Framework Example/WEPopover.framework/popoverBgSimple.png b/WEPopover Framework Example/WEPopover.framework/popoverBgSimple.png new file mode 100755 index 0000000..3cdf457 Binary files /dev/null and b/WEPopover Framework Example/WEPopover.framework/popoverBgSimple.png differ diff --git a/WEPopover Framework Example/WEPopover.xcodeproj/project.pbxproj b/WEPopover Framework Example/WEPopover.xcodeproj/project.pbxproj new file mode 100755 index 0000000..2be7997 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.xcodeproj/project.pbxproj @@ -0,0 +1,340 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* WEPopoverAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* WEPopoverAppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 2899E5220DE3E06400AC0155 /* WEPopoverViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* WEPopoverViewController.xib */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 28D7ACF80DDB3853001CB0EB /* WEPopoverViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* WEPopoverViewController.m */; }; + 7496C86112D363AC00F93229 /* WEPopoverTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7496C86012D363AC00F93229 /* WEPopoverTableViewController.m */; }; + 749FAE871286130000AB97F9 /* WEPopoverContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE821286130000AB97F9 /* WEPopoverContentViewController.m */; }; + 8206E7F215CBE2A3007433AF /* popoverArrowDown@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7E915CBE2A3007433AF /* popoverArrowDown@2x.png */; }; + 8206E7F315CBE2A3007433AF /* popoverArrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7EA15CBE2A3007433AF /* popoverArrowLeft.png */; }; + 8206E7F415CBE2A3007433AF /* popoverArrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7EB15CBE2A3007433AF /* popoverArrowLeft@2x.png */; }; + 8206E7F515CBE2A3007433AF /* popoverArrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7EC15CBE2A3007433AF /* popoverArrowRight.png */; }; + 8206E7F615CBE2A3007433AF /* popoverArrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7ED15CBE2A3007433AF /* popoverArrowRight@2x.png */; }; + 8206E7F715CBE2A3007433AF /* popoverArrowUp.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7EE15CBE2A3007433AF /* popoverArrowUp.png */; }; + 8206E7F815CBE2A3007433AF /* popoverArrowUp@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7EF15CBE2A3007433AF /* popoverArrowUp@2x.png */; }; + 8206E7F915CBE2A3007433AF /* popoverBg.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7F015CBE2A3007433AF /* popoverBg.png */; }; + 8206E7FA15CBE2A3007433AF /* popoverBg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8206E7F115CBE2A3007433AF /* popoverBg@2x.png */; }; + 82906C1A15CBE72300621C68 /* WEPopover.framework in Resources */ = {isa = PBXBuildFile; fileRef = 82906C1915CBE72300621C68 /* WEPopover.framework */; }; + 82906C1B15CBE73300621C68 /* WEPopover.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82906C1915CBE72300621C68 /* WEPopover.framework */; }; + 82906C2215CBE78900621C68 /* popoverArrowDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 82906C2115CBE78900621C68 /* popoverArrowDown.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* WEPopoverAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* WEPopoverAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WEPopoverAppDelegate.m; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* WEPopover.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WEPopover.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 2899E5210DE3E06400AC0155 /* WEPopoverViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WEPopoverViewController.xib; sourceTree = ""; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* WEPopoverViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverViewController.h; sourceTree = ""; }; + 28D7ACF70DDB3853001CB0EB /* WEPopoverViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WEPopoverViewController.m; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* WEPopover_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopover_Prefix.pch; sourceTree = ""; }; + 7496C85F12D363AC00F93229 /* WEPopoverTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverTableViewController.h; sourceTree = ""; }; + 7496C86012D363AC00F93229 /* WEPopoverTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WEPopoverTableViewController.m; sourceTree = ""; }; + 749FAE811286130000AB97F9 /* WEPopoverContentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverContentViewController.h; sourceTree = ""; }; + 749FAE821286130000AB97F9 /* WEPopoverContentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WEPopoverContentViewController.m; sourceTree = ""; }; + 8206E7E915CBE2A3007433AF /* popoverArrowDown@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popoverArrowDown@2x.png"; sourceTree = ""; }; + 8206E7EA15CBE2A3007433AF /* popoverArrowLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popoverArrowLeft.png; sourceTree = ""; }; + 8206E7EB15CBE2A3007433AF /* popoverArrowLeft@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popoverArrowLeft@2x.png"; sourceTree = ""; }; + 8206E7EC15CBE2A3007433AF /* popoverArrowRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popoverArrowRight.png; sourceTree = ""; }; + 8206E7ED15CBE2A3007433AF /* popoverArrowRight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popoverArrowRight@2x.png"; sourceTree = ""; }; + 8206E7EE15CBE2A3007433AF /* popoverArrowUp.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popoverArrowUp.png; sourceTree = ""; }; + 8206E7EF15CBE2A3007433AF /* popoverArrowUp@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popoverArrowUp@2x.png"; sourceTree = ""; }; + 8206E7F015CBE2A3007433AF /* popoverBg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popoverBg.png; sourceTree = ""; }; + 8206E7F115CBE2A3007433AF /* popoverBg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popoverBg@2x.png"; sourceTree = ""; }; + 82906C1915CBE72300621C68 /* WEPopover.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WEPopover.framework; sourceTree = ""; }; + 82906C2115CBE78900621C68 /* popoverArrowDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = popoverArrowDown.png; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* WEPopover-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "WEPopover-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 82906C1B15CBE73300621C68 /* WEPopover.framework in Frameworks */, + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 1D3623240D0F684500981E51 /* WEPopoverAppDelegate.h */, + 1D3623250D0F684500981E51 /* WEPopoverAppDelegate.m */, + 749FAE811286130000AB97F9 /* WEPopoverContentViewController.h */, + 749FAE821286130000AB97F9 /* WEPopoverContentViewController.m */, + 28D7ACF60DDB3853001CB0EB /* WEPopoverViewController.h */, + 28D7ACF70DDB3853001CB0EB /* WEPopoverViewController.m */, + 7496C85F12D363AC00F93229 /* WEPopoverTableViewController.h */, + 7496C86012D363AC00F93229 /* WEPopoverTableViewController.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* WEPopover.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 82906C1915CBE72300621C68 /* WEPopover.framework */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* WEPopover_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 8206E7E815CBE2A3007433AF /* Personalized Popover */, + 2899E5210DE3E06400AC0155 /* WEPopoverViewController.xib */, + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* WEPopover-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8206E7E815CBE2A3007433AF /* Personalized Popover */ = { + isa = PBXGroup; + children = ( + 82906C2115CBE78900621C68 /* popoverArrowDown.png */, + 8206E7E915CBE2A3007433AF /* popoverArrowDown@2x.png */, + 8206E7EA15CBE2A3007433AF /* popoverArrowLeft.png */, + 8206E7EB15CBE2A3007433AF /* popoverArrowLeft@2x.png */, + 8206E7EC15CBE2A3007433AF /* popoverArrowRight.png */, + 8206E7ED15CBE2A3007433AF /* popoverArrowRight@2x.png */, + 8206E7EE15CBE2A3007433AF /* popoverArrowUp.png */, + 8206E7EF15CBE2A3007433AF /* popoverArrowUp@2x.png */, + 8206E7F015CBE2A3007433AF /* popoverBg.png */, + 8206E7F115CBE2A3007433AF /* popoverBg@2x.png */, + ); + path = "Personalized Popover"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* WEPopover */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "WEPopover" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WEPopover; + productName = WEPopover; + productReference = 1D6058910D05DD3D006BFB54 /* WEPopover.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + ORGANIZATIONNAME = "Werner IT Consultancy"; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WEPopover" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* WEPopover */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82906C1A15CBE72300621C68 /* WEPopover.framework in Resources */, + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 2899E5220DE3E06400AC0155 /* WEPopoverViewController.xib in Resources */, + 8206E7F215CBE2A3007433AF /* popoverArrowDown@2x.png in Resources */, + 8206E7F315CBE2A3007433AF /* popoverArrowLeft.png in Resources */, + 8206E7F415CBE2A3007433AF /* popoverArrowLeft@2x.png in Resources */, + 8206E7F515CBE2A3007433AF /* popoverArrowRight.png in Resources */, + 8206E7F615CBE2A3007433AF /* popoverArrowRight@2x.png in Resources */, + 8206E7F715CBE2A3007433AF /* popoverArrowUp.png in Resources */, + 8206E7F815CBE2A3007433AF /* popoverArrowUp@2x.png in Resources */, + 8206E7F915CBE2A3007433AF /* popoverBg.png in Resources */, + 8206E7FA15CBE2A3007433AF /* popoverBg@2x.png in Resources */, + 82906C2215CBE78900621C68 /* popoverArrowDown.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* WEPopoverAppDelegate.m in Sources */, + 28D7ACF80DDB3853001CB0EB /* WEPopoverViewController.m in Sources */, + 749FAE871286130000AB97F9 /* WEPopoverContentViewController.m in Sources */, + 7496C86112D363AC00F93229 /* WEPopoverTableViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WEPopover_Prefix.pch; + INFOPLIST_FILE = "WEPopover-Info.plist"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = WEPopover; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WEPopover_Prefix.pch; + INFOPLIST_FILE = "WEPopover-Info.plist"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = WEPopover; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PREBINDING = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "WEPopover" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WEPopover" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..08e5e81 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate b/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..d734bb0 Binary files /dev/null and b/WEPopover Framework Example/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme b/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme new file mode 100644 index 0000000..f09450e --- /dev/null +++ b/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist b/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..09aef12 --- /dev/null +++ b/WEPopover Framework Example/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + WEPopover.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 1D6058900D05DD3D006BFB54 + + primary + + + + + diff --git a/WEPopover Framework Example/WEPopoverViewController.xib b/WEPopover Framework Example/WEPopoverViewController.xib new file mode 100755 index 0000000..143d80c --- /dev/null +++ b/WEPopover Framework Example/WEPopoverViewController.xib @@ -0,0 +1,404 @@ + + + + 1024 + 10F569 + 804 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 123 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + YES + + + 292 + {{20, 403}, {280, 37}} + + NO + IBCocoaTouchFramework + 0 + 0 + + Helvetica-Bold + 15 + 16 + + 1 + Show Popover + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + + {320, 460} + + + 3 + MC43NQA + + 2 + + + NO + + IBCocoaTouchFramework + + + + + YES + + + view + + + + 7 + + + + onButtonClick: + + + 7 + + 9 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 6 + + + YES + + + + + + 8 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 6.IBEditorWindowLastContentRect + 6.IBPluginDependency + 8.IBPluginDependency + + + YES + WEPopoverViewController + UIResponder + {{239, 654}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 9 + + + + YES + + WEPopoverViewController + UIViewController + + onButtonClick: + UIButton + + + onButtonClick: + + onButtonClick: + UIButton + + + + IBProjectSource + Classes/WEPopoverViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIButton + UIControl + + IBFrameworkSource + UIKit.framework/Headers/UIButton.h + + + + UIControl + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIControl.h + + + + UIResponder + NSObject + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UIPopoverController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UISplitViewController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + WEPopover.xcodeproj + 3 + 123 + + diff --git a/WEPopover Framework Example/WEPopover_Prefix.pch b/WEPopover Framework Example/WEPopover_Prefix.pch new file mode 100755 index 0000000..3760bfa --- /dev/null +++ b/WEPopover Framework Example/WEPopover_Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header for all source files of the 'WEPopover' target in the 'WEPopover' project +// + +#ifdef __OBJC__ + #import + #import + #import +#endif diff --git a/WEPopover Framework Example/main.m b/WEPopover Framework Example/main.m new file mode 100755 index 0000000..b0ac185 --- /dev/null +++ b/WEPopover Framework Example/main.m @@ -0,0 +1,17 @@ +// +// main.m +// WEPopover +// +// Created by Werner Altewischer on 06/11/10. +// Copyright 2010 Werner IT Consultancy. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +} diff --git a/WEPopover.xcodeproj/project.pbxproj b/WEPopover.xcodeproj/project.pbxproj index f059514..34442a1 100755 --- a/WEPopover.xcodeproj/project.pbxproj +++ b/WEPopover.xcodeproj/project.pbxproj @@ -36,6 +36,21 @@ 749FAE861286130000AB97F9 /* WEPopoverContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE801286130000AB97F9 /* WEPopoverContainerView.m */; }; 749FAE871286130000AB97F9 /* WEPopoverContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE821286130000AB97F9 /* WEPopoverContentViewController.m */; }; 749FAE881286130000AB97F9 /* WEPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE841286130000AB97F9 /* WEPopoverController.m */; }; + 82253FF315CBB00000F51685 /* WETouchableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 74634FFF13729C6F000EF936 /* WETouchableView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82253FF415CBB00000F51685 /* WEPopoverContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 749FAE7F1286130000AB97F9 /* WEPopoverContainerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82253FF515CBB00000F51685 /* WEPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = 749FAE831286130000AB97F9 /* WEPopoverController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82253FF615CBB00000F51685 /* WEPopoverParentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 749FAE851286130000AB97F9 /* WEPopoverParentView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82253FF715CBB00000F51685 /* UIBarButtonItem+WEPopover.h in Headers */ = {isa = PBXBuildFile; fileRef = 746B0A1B137454A000C5A8B5 /* UIBarButtonItem+WEPopover.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82253FF815CBB01800F51685 /* WETouchableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7463500013729C6F000EF936 /* WETouchableView.m */; }; + 82253FF915CBB01800F51685 /* WEPopoverContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE801286130000AB97F9 /* WEPopoverContainerView.m */; }; + 82253FFA15CBB01800F51685 /* WEPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = 749FAE841286130000AB97F9 /* WEPopoverController.m */; }; + 82253FFB15CBB01800F51685 /* UIBarButtonItem+WEPopover.m in Sources */ = {isa = PBXBuildFile; fileRef = 746B0A1C137454A000C5A8B5 /* UIBarButtonItem+WEPopover.m */; }; + 8225400C15CBB0F100F51685 /* WEPopover.h in Headers */ = {isa = PBXBuildFile; fileRef = 8225400B15CBB0F100F51685 /* WEPopover.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82C6033415CBCBBD00292289 /* popoverBgSimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 7407D7C313A67A930074B83C /* popoverBgSimple.png */; }; + 82C6033515CBCBBD00292289 /* popoverArrowUpSimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 7407D7C413A67A930074B83C /* popoverArrowUpSimple.png */; }; + 82C6033615CBCBBD00292289 /* popoverArrowRightSimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 7407D7C513A67A930074B83C /* popoverArrowRightSimple.png */; }; + 82C6033715CBCBBD00292289 /* popoverArrowLeftSimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 7407D7C613A67A930074B83C /* popoverArrowLeftSimple.png */; }; + 82C6033815CBCBBD00292289 /* popoverArrowDownSimple.png in Resources */ = {isa = PBXBuildFile; fileRef = 7407D7C713A67A930074B83C /* popoverArrowDownSimple.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -79,6 +94,9 @@ 749FAE831286130000AB97F9 /* WEPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverController.h; sourceTree = ""; }; 749FAE841286130000AB97F9 /* WEPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WEPopoverController.m; sourceTree = ""; }; 749FAE851286130000AB97F9 /* WEPopoverParentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopoverParentView.h; sourceTree = ""; }; + 82253FE315CBADD100F51685 /* WEPopover.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WEPopover.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 82253FE415CBADD100F51685 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 8225400B15CBB0F100F51685 /* WEPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WEPopover.h; sourceTree = ""; }; 8D1107310486CEB800E47090 /* WEPopover-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "WEPopover-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -93,6 +111,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82253FE015CBADD100F51685 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -116,6 +141,7 @@ isa = PBXGroup; children = ( 1D6058910D05DD3D006BFB54 /* WEPopover.app */, + 82253FE315CBADD100F51685 /* WEPopover.framework */, ); name = Products; sourceTree = ""; @@ -158,6 +184,7 @@ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, 288765A40DF7441C002DB57D /* CoreGraphics.framework */, + 82253FE415CBADD100F51685 /* CoreFoundation.framework */, ); name = Frameworks; sourceTree = ""; @@ -194,6 +221,7 @@ 749FAE6F1286123500AB97F9 /* Popover */ = { isa = PBXGroup; children = ( + 8225400B15CBB0F100F51685 /* WEPopover.h */, 74634FFF13729C6F000EF936 /* WETouchableView.h */, 7463500013729C6F000EF936 /* WETouchableView.m */, 749FAE7F1286130000AB97F9 /* WEPopoverContainerView.h */, @@ -218,6 +246,22 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 82253FF215CBAFEB00F51685 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 82253FF315CBB00000F51685 /* WETouchableView.h in Headers */, + 82253FF415CBB00000F51685 /* WEPopoverContainerView.h in Headers */, + 82253FF515CBB00000F51685 /* WEPopoverController.h in Headers */, + 82253FF615CBB00000F51685 /* WEPopoverParentView.h in Headers */, + 82253FF715CBB00000F51685 /* UIBarButtonItem+WEPopover.h in Headers */, + 8225400C15CBB0F100F51685 /* WEPopover.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ 1D6058900D05DD3D006BFB54 /* WEPopover */ = { isa = PBXNativeTarget; @@ -236,6 +280,25 @@ productReference = 1D6058910D05DD3D006BFB54 /* WEPopover.app */; productType = "com.apple.product-type.application"; }; + 82253FE215CBADD100F51685 /* WEPopover Framework */ = { + isa = PBXNativeTarget; + buildConfigurationList = 82253FEF15CBADD100F51685 /* Build configuration list for PBXNativeTarget "WEPopover Framework" */; + buildPhases = ( + 82253FDF15CBADD100F51685 /* Sources */, + 82253FE015CBADD100F51685 /* Frameworks */, + 82253FE115CBADD100F51685 /* Resources */, + 82253FF215CBAFEB00F51685 /* Headers */, + 8225402315CBB6E400F51685 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "WEPopover Framework"; + productName = "WEPopover Framework"; + productReference = 82253FE315CBADD100F51685 /* WEPopover.framework */; + productType = "com.apple.product-type.bundle"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -253,12 +316,14 @@ Japanese, French, German, + en, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; projectRoot = ""; targets = ( 1D6058900D05DD3D006BFB54 /* WEPopover */, + 82253FE215CBADD100F51685 /* WEPopover Framework */, ); }; /* End PBXProject section */ @@ -288,8 +353,36 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82253FE115CBADD100F51685 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82C6033415CBCBBD00292289 /* popoverBgSimple.png in Resources */, + 82C6033515CBCBBD00292289 /* popoverArrowUpSimple.png in Resources */, + 82C6033615CBCBBD00292289 /* popoverArrowRightSimple.png in Resources */, + 82C6033715CBCBBD00292289 /* popoverArrowLeftSimple.png in Resources */, + 82C6033815CBCBBD00292289 /* popoverArrowDownSimple.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 8225402315CBB6E400F51685 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Script to build the framework as universal from:\n# https://github.com/jverkoey/iOS-Framework#step-3-build-the-other-platform\n# With some changes to adapt it to use this method:\n# http://db-in.com/blog/2011/05/creating-universal-framework-to-iphone-ios/#list_contents\nset -e\nset +u\n\n# Avoid recursively calling this script.\nif [[ $SF_MASTER_SCRIPT_RUNNING ]]\nthen\n exit 0\nfi\nset -u\nexport SF_MASTER_SCRIPT_RUNNING=1\n\nSF_TARGET_NAME=${PROJECT_NAME}\nSF_EXECUTABLE_PATH=\"${SF_TARGET_NAME}\"\nSF_WRAPPER_NAME=\"${SF_TARGET_NAME}.framework\"\n\n# The following conditionals come from\n# https://github.com/kstenerud/iOS-Universal-Framework\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n SF_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n SF_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SF_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n SF_OTHER_PLATFORM=iphonesimulator\nelse\n SF_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$SF_SDK_PLATFORM$ ]]\nthen\n SF_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}\"\nelse\n echo \"Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n# Build the other platform\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" OBJROOT=\"${OBJROOT}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\" $ACTION\n\n# Smash the two static libraries into one fat binary and store it in a temporal file\nrm -f \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\nlipo -create \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/${SF_EXECUTABLE_PATH}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/${SF_EXECUTABLE_PATH}\" -output \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\n\n# Copy the generated framework to the build directory\nif [ -d \"${SRCROOT}/build\" ]; then\n rm -fr \"${SRCROOT}/build\"\nfi\n\nmkdir -p \"${SRCROOT}/build\"\ncp -fR \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}\" \"${SRCROOT}/build/${SF_WRAPPER_NAME}\"\n\n# Copy the universal binary to the framework\ncp -a \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\" \"${SRCROOT}/build/${SF_WRAPPER_NAME}\"\nrm -f \"${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1D60588E0D05DD3D006BFB54 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -307,6 +400,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 82253FDF15CBADD100F51685 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 82253FF815CBB01800F51685 /* WETouchableView.m in Sources */, + 82253FF915CBB01800F51685 /* WEPopoverContainerView.m in Sources */, + 82253FFA15CBB01800F51685 /* WEPopoverController.m in Sources */, + 82253FFB15CBB01800F51685 /* UIBarButtonItem+WEPopover.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -314,6 +418,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -321,6 +426,7 @@ GCC_PREFIX_HEADER = WEPopover_Prefix.pch; INFOPLIST_FILE = "WEPopover-Info.plist"; PRODUCT_NAME = WEPopover; + VALID_ARCHS = "armv7 armv7s"; }; name = Debug; }; @@ -328,12 +434,88 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = WEPopover_Prefix.pch; INFOPLIST_FILE = "WEPopover-Info.plist"; PRODUCT_NAME = WEPopover; VALIDATE_PRODUCT = YES; + VALID_ARCHS = "armv7 armv7s"; + }; + name = Release; + }; + 82253FED15CBADD100F51685 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + armv7, + armv7s, + ); + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = WEPopover; + SDKROOT = iphoneos; + VALID_ARCHS = "armv7 armv7s"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 82253FEE15CBADD100F51685 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + armv7, + armv7s, + ); + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + MACOSX_DEPLOYMENT_TARGET = ""; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = WEPopover; + SDKROOT = iphoneos; + VALID_ARCHS = "armv7 armv7s"; + WRAPPER_EXTENSION = framework; }; name = Release; }; @@ -345,10 +527,12 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; PREBINDING = NO; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s"; }; name = Debug; }; @@ -360,10 +544,12 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s"; }; name = Release; }; @@ -379,6 +565,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 82253FEF15CBADD100F51685 /* Build configuration list for PBXNativeTarget "WEPopover Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 82253FED15CBADD100F51685 /* Debug */, + 82253FEE15CBADD100F51685 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WEPopover" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..08e5e81 --- /dev/null +++ b/WEPopover.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate b/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..10032f1 Binary files /dev/null and b/WEPopover.xcodeproj/project.xcworkspace/xcuserdata/jose.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover Framework.xcscheme b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover Framework.xcscheme new file mode 100644 index 0000000..da53a79 --- /dev/null +++ b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover Framework.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme new file mode 100644 index 0000000..7ffd287 --- /dev/null +++ b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/WEPopover.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..135254d --- /dev/null +++ b/WEPopover.xcodeproj/xcuserdata/jose.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,41 @@ + + + + + SchemeUserState + + WEPopover Framework.xcscheme + + isShown + + orderHint + 1 + + WEPopover.xcscheme + + isShown + + orderHint + 0 + + + SuppressBuildableAutocreation + + 1D6058900D05DD3D006BFB54 + + primary + + + 82253FE215CBADD100F51685 + + primary + + + 8225401615CBB4FA00F51685 + + primary + + + + + diff --git a/screenshots/Integrate_WEPopover_1.png b/screenshots/Integrate_WEPopover_1.png new file mode 100644 index 0000000..c7722e9 Binary files /dev/null and b/screenshots/Integrate_WEPopover_1.png differ diff --git a/screenshots/Integrate_WEPopover_2.png b/screenshots/Integrate_WEPopover_2.png new file mode 100644 index 0000000..38fc6fe Binary files /dev/null and b/screenshots/Integrate_WEPopover_2.png differ diff --git a/screenshots/Integrate_WEPopover_3.png b/screenshots/Integrate_WEPopover_3.png new file mode 100644 index 0000000..363299e Binary files /dev/null and b/screenshots/Integrate_WEPopover_3.png differ diff --git a/screenshots/Integrate_WEPopover_4.png b/screenshots/Integrate_WEPopover_4.png new file mode 100644 index 0000000..90bc2ba Binary files /dev/null and b/screenshots/Integrate_WEPopover_4.png differ