├── KSCustomPopover ├── en.lproj │ ├── InfoPlist.strings │ └── MainStoryboard.storyboard ├── popover-black-bcg-image.png ├── popover-black-bcg-image@2x.png ├── popover-black-top-arrow-image.png ├── popover-black-bottom-arrow-image.png ├── popover-black-left-arrow-image.png ├── popover-black-right-arrow-image.png ├── popover-black-top-arrow-image@2x.png ├── popover-black-left-arrow-image@2x.png ├── popover-black-right-arrow-image@2x.png ├── popover-black-bottom-arrow-image@2x.png ├── main.m ├── KSCustomPopover-Prefix.pch ├── KSCustomPopoverAppDelegate.h ├── KSCustomPopoverMainViewController.h ├── KSCustomPopover-Info.plist ├── KSCustomPopoverFlipsideViewController.h ├── KSCustomPopoverBackgroundView.h ├── KSCustomPopoverFlipsideViewController.m ├── KSCustomPopoverAppDelegate.m ├── KSCustomPopoverMainViewController.m └── KSCustomPopoverBackgroundView.m ├── README ├── LICENSE ├── .gitignore └── KSCustomPopover.xcodeproj └── project.pbxproj /KSCustomPopover/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-bcg-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-bcg-image.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-bcg-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-bcg-image@2x.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-top-arrow-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-top-arrow-image.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-bottom-arrow-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-bottom-arrow-image.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-left-arrow-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-left-arrow-image.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-right-arrow-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-right-arrow-image.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-top-arrow-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-top-arrow-image@2x.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-left-arrow-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-left-arrow-image@2x.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-right-arrow-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-right-arrow-image@2x.png -------------------------------------------------------------------------------- /KSCustomPopover/popover-black-bottom-arrow-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudlab/KSCustomUIPopover/master/KSCustomPopover/popover-black-bottom-arrow-image@2x.png -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | KSCustomPopover is an example project for my article: http://www.scianski.com/customizing-uipopover-with-uipopoverbackgroundview/. It shows how to customize UIPopover with images. Project is simple Utility Application template with additional KSCustomPopoverBackgroundView subclass of UIPopoverBackgroundView. This project uses features only available in iOS SDK 5.0 and later. -------------------------------------------------------------------------------- /KSCustomPopover/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // KSCustomPopover 4 | // 5 | // Created by Chris Scianski on 12.02.2012. 6 | 7 | #import 8 | 9 | #import "KSCustomPopoverAppDelegate.h" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([KSCustomPopoverAppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopover-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'KSCustomPopover' target in the 'KSCustomPopover' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2012, Krzysztof Scianski 2 | http://scianski.com 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # XCode (and ancestors) per-user config (very noisy, and not relevant) 2 | *.mode1 3 | *.mode1v3 4 | *.mode2v3 5 | *.perspective 6 | *.perspectivev3 7 | *.pbxuser 8 | 9 | *.pyc 10 | *~.nib/ 11 | 12 | # Generated files 13 | VersionX-revision.h 14 | 15 | 16 | # build products 17 | build/* 18 | build/ 19 | *.[oa] 20 | 21 | # Other source repository archive directories (protects when importing) 22 | .hg 23 | .svn 24 | CVS 25 | 26 | # Textmate - if you build your xcode projects with it 27 | *.tm_build_errors 28 | 29 | # osx noise 30 | .DS_Store 31 | profile 32 | 33 | *tmproj 34 | **/~* 35 | 36 | ############### 37 | 38 | *xcodeproj/xcuserdata/* 39 | *xcodeproj/project.xcworkspace/xcuserdata/* 40 | 41 | *xcodeproj/*mode* 42 | *xcodeproj/*pbxuser 43 | *xcodeproj/*per* 44 | *xcodeproj/project.xcworkspace 45 | *xcodeproj/xcuserdata 46 | **/build 47 | **/*xcodeproj/*mode* 48 | **/*xcodeproj/*pbxuser 49 | **/*xcodeproj/*per* 50 | **/*xcodeproj/project.xcworkspace 51 | **/*xcodeproj/xcuserdata 52 | **/**/*xcodeproj/*mode* 53 | **/**/*xcodeproj/*pbxuser 54 | **/**/*xcodeproj/*per* 55 | **/**/*xcodeproj/project.xcworkspace 56 | **/**/*xcodeproj/xcuserdata 57 | 58 | WorkspaceState.xcuserstate 59 | 60 | KSCustomPopover.xcodeproj/xcuserdata/* 61 | KSCustomPopover.xcodeproj/project.xcworkspace/xcuserdata/* -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverAppDelegate.h 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | @interface KSCustomPopoverAppDelegate : UIResponder 30 | 31 | @property (strong, nonatomic) UIWindow *window; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverMainViewController.h 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "KSCustomPopoverFlipsideViewController.h" 28 | 29 | @interface KSCustomPopoverMainViewController : UIViewController 30 | 31 | @property (strong, nonatomic) UIPopoverController *flipsidePopoverController; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopover-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.scianski.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIMainStoryboardFile 30 | MainStoryboard 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverFlipsideViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverFlipsideViewController.h 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | @class KSCustomPopoverFlipsideViewController; 30 | 31 | @protocol KSCustomPopoverFlipsideViewControllerDelegate 32 | - (void)flipsideViewControllerDidFinish:(KSCustomPopoverFlipsideViewController *)controller; 33 | @end 34 | 35 | @interface KSCustomPopoverFlipsideViewController : UIViewController 36 | 37 | @property (weak, nonatomic) IBOutlet id delegate; 38 | 39 | - (IBAction)done:(id)sender; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverBackgroundView.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSPopoverBackgorundView.h 3 | // 4 | // Created by Krzysztof Scianski on 12.02.2012. 5 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import 27 | #import 28 | 29 | @interface KSCustomPopoverBackgroundView : UIPopoverBackgroundView 30 | { 31 | CGFloat _arrowOffset; 32 | UIPopoverArrowDirection _arrowDirection; 33 | UIImageView *_arrowImageView; 34 | UIImageView *_popoverBackgroundImageView; 35 | } 36 | 37 | @property (nonatomic, readwrite) CGFloat arrowOffset; 38 | @property (nonatomic, readwrite) UIPopoverArrowDirection arrowDirection; 39 | @property (nonatomic, readwrite, strong) UIImageView *arrowImageView; 40 | @property (nonatomic, readwrite, strong) UIImageView *popoverBackgroundImageView; 41 | 42 | + (CGFloat)arrowHeight; 43 | + (CGFloat)arrowBase; 44 | + (UIEdgeInsets)contentViewInsets; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverFlipsideViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverFlipsideViewController.m 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "KSCustomPopoverFlipsideViewController.h" 28 | 29 | @implementation KSCustomPopoverFlipsideViewController 30 | 31 | @synthesize delegate = _delegate; 32 | 33 | - (void)awakeFromNib 34 | { 35 | self.contentSizeForViewInPopover = CGSizeMake(320.0, 480.0); 36 | [super awakeFromNib]; 37 | } 38 | 39 | - (void)didReceiveMemoryWarning 40 | { 41 | [super didReceiveMemoryWarning]; 42 | // Release any cached data, images, etc that aren't in use. 43 | } 44 | 45 | #pragma mark - View lifecycle 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | // Do any additional setup after loading the view, typically from a nib. 51 | } 52 | 53 | - (void)viewDidUnload 54 | { 55 | [super viewDidUnload]; 56 | // Release any retained subviews of the main view. 57 | // e.g. self.myOutlet = nil; 58 | } 59 | 60 | - (void)viewWillAppear:(BOOL)animated 61 | { 62 | [super viewWillAppear:animated]; 63 | } 64 | 65 | - (void)viewDidAppear:(BOOL)animated 66 | { 67 | [super viewDidAppear:animated]; 68 | } 69 | 70 | - (void)viewWillDisappear:(BOOL)animated 71 | { 72 | [super viewWillDisappear:animated]; 73 | } 74 | 75 | - (void)viewDidDisappear:(BOOL)animated 76 | { 77 | [super viewDidDisappear:animated]; 78 | } 79 | 80 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 81 | { 82 | // Return YES for supported orientations 83 | return YES; 84 | } 85 | 86 | #pragma mark - Actions 87 | 88 | - (IBAction)done:(id)sender 89 | { 90 | [self.delegate flipsideViewControllerDidFinish:self]; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverAppDelegate.m 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "KSCustomPopoverAppDelegate.h" 28 | 29 | @implementation KSCustomPopoverAppDelegate 30 | 31 | @synthesize window = _window; 32 | 33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 34 | { 35 | // Override point for customization after application launch. 36 | return YES; 37 | } 38 | 39 | - (void)applicationWillResignActive:(UIApplication *)application 40 | { 41 | /* 42 | 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. 43 | 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. 44 | */ 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | /* 50 | 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. 51 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 52 | */ 53 | } 54 | 55 | - (void)applicationWillEnterForeground:(UIApplication *)application 56 | { 57 | /* 58 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 59 | */ 60 | } 61 | 62 | - (void)applicationDidBecomeActive:(UIApplication *)application 63 | { 64 | /* 65 | 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. 66 | */ 67 | } 68 | 69 | - (void)applicationWillTerminate:(UIApplication *)application 70 | { 71 | /* 72 | Called when the application is about to terminate. 73 | Save data if appropriate. 74 | See also applicationDidEnterBackground:. 75 | */ 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCustomPopoverMainViewController.m 3 | // KSCustomPopover 4 | // 5 | // Created by Krzysztof Scianski on 12.02.2012. 6 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "KSCustomPopoverMainViewController.h" 28 | #import "KSCustomPopoverBackgroundView.h" 29 | 30 | @implementation KSCustomPopoverMainViewController 31 | 32 | @synthesize flipsidePopoverController = _flipsidePopoverController; 33 | 34 | - (void)didReceiveMemoryWarning 35 | { 36 | [super didReceiveMemoryWarning]; 37 | // Release any cached data, images, etc that aren't in use. 38 | } 39 | 40 | #pragma mark - View lifecycle 41 | 42 | - (void)viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | // Do any additional setup after loading the view, typically from a nib. 46 | } 47 | 48 | - (void)viewDidUnload 49 | { 50 | [super viewDidUnload]; 51 | // Release any retained subviews of the main view. 52 | // e.g. self.myOutlet = nil; 53 | } 54 | 55 | - (void)viewWillAppear:(BOOL)animated 56 | { 57 | [super viewWillAppear:animated]; 58 | } 59 | 60 | - (void)viewDidAppear:(BOOL)animated 61 | { 62 | [super viewDidAppear:animated]; 63 | } 64 | 65 | - (void)viewWillDisappear:(BOOL)animated 66 | { 67 | [super viewWillDisappear:animated]; 68 | } 69 | 70 | - (void)viewDidDisappear:(BOOL)animated 71 | { 72 | [super viewDidDisappear:animated]; 73 | } 74 | 75 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 76 | { 77 | // Return YES for supported orientations 78 | return YES; 79 | } 80 | 81 | #pragma mark - Flipside View Controller 82 | 83 | - (void)flipsideViewControllerDidFinish:(KSCustomPopoverFlipsideViewController *)controller 84 | { 85 | [self.flipsidePopoverController dismissPopoverAnimated:YES]; 86 | self.flipsidePopoverController = nil; 87 | } 88 | 89 | - (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController 90 | { 91 | self.flipsidePopoverController = nil; 92 | } 93 | 94 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 95 | { 96 | if ([[segue identifier] isEqualToString:@"showAlternate"]) { 97 | [[segue destinationViewController] setDelegate:self]; 98 | UIPopoverController *popoverController = [(UIStoryboardPopoverSegue *)segue popoverController]; 99 | popoverController.popoverBackgroundViewClass = [KSCustomPopoverBackgroundView class]; 100 | self.flipsidePopoverController = popoverController; 101 | 102 | popoverController.delegate = self; 103 | } 104 | } 105 | 106 | - (IBAction)togglePopover:(id)sender 107 | { 108 | if (self.flipsidePopoverController) { 109 | [self.flipsidePopoverController dismissPopoverAnimated:YES]; 110 | self.flipsidePopoverController = nil; 111 | } else { 112 | [self performSegueWithIdentifier:@"showAlternate" sender:sender]; 113 | } 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /KSCustomPopover/en.lproj/MainStoryboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 54 | 55 | 56 | 57 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /KSCustomPopover/KSCustomPopoverBackgroundView.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSPopoverBackgorundView.m 3 | // 4 | // Created by Krzysztof Scianski on 12.02.2012. 5 | // Copyright (c) 2012 Krzysztof Scianski. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import "KSCustomPopoverBackgroundView.h" 27 | 28 | // Predefined arrow image width and height 29 | #define ARROW_WIDTH 35.0 30 | #define ARROW_HEIGHT 19.0 31 | 32 | // Predefined content insets 33 | #define TOP_CONTENT_INSET 8 34 | #define LEFT_CONTENT_INSET 8 35 | #define BOTTOM_CONTENT_INSET 8 36 | #define RIGHT_CONTENT_INSET 8 37 | 38 | #pragma mark - Private interface 39 | 40 | @interface KSCustomPopoverBackgroundView () 41 | { 42 | UIImage *_topArrowImage; 43 | UIImage *_leftArrowImage; 44 | UIImage *_rightArrowImage; 45 | UIImage *_bottomArrowImage; 46 | } 47 | 48 | @end 49 | 50 | #pragma mark - Implementation 51 | 52 | @implementation KSCustomPopoverBackgroundView 53 | 54 | @synthesize arrowOffset = _arrowOffset, arrowDirection = _arrowDirection, popoverBackgroundImageView = _popoverBackgroundImageView, arrowImageView = _arrowImageView; 55 | 56 | #pragma mark - Overriden class methods 57 | 58 | // The width of the arrow triangle at its base. 59 | + (CGFloat)arrowBase 60 | { 61 | return ARROW_WIDTH; 62 | } 63 | 64 | // The height of the arrow (measured in points) from its base to its tip. 65 | + (CGFloat)arrowHeight 66 | { 67 | return ARROW_HEIGHT; 68 | } 69 | 70 | // The insets for the content portion of the popover. 71 | + (UIEdgeInsets)contentViewInsets 72 | { 73 | return UIEdgeInsetsMake(TOP_CONTENT_INSET, LEFT_CONTENT_INSET, BOTTOM_CONTENT_INSET, RIGHT_CONTENT_INSET); 74 | } 75 | 76 | #pragma mark - Custom setters for updating layout 77 | 78 | // Whenever arrow changes direction or position layout subviews will be called in order to update arrow and backgorund frames 79 | 80 | -(void) setArrowOffset:(CGFloat)arrowOffset 81 | { 82 | _arrowOffset = arrowOffset; 83 | [self setNeedsLayout]; 84 | } 85 | 86 | -(void) setArrowDirection:(UIPopoverArrowDirection)arrowDirection 87 | { 88 | _arrowDirection = arrowDirection; 89 | [self setNeedsLayout]; 90 | } 91 | 92 | #pragma mark - Initialization 93 | 94 | -(id)initWithFrame:(CGRect)frame 95 | { 96 | if (self = [super initWithFrame:frame]) 97 | { 98 | _topArrowImage = [UIImage imageNamed:@"popover-black-top-arrow-image.png"]; 99 | _leftArrowImage = [UIImage imageNamed:@"popover-black-left-arrow-image.png"]; 100 | _bottomArrowImage = [UIImage imageNamed:@"popover-black-bottom-arrow-image.png"]; 101 | _rightArrowImage = [UIImage imageNamed:@"popover-black-right-arrow-image.png"]; 102 | 103 | UIImage *popoverBackgroundImage = [[UIImage imageNamed:@"popover-black-bcg-image.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(49, 46, 49, 45)]; 104 | self.popoverBackgroundImageView = [[UIImageView alloc] initWithImage:popoverBackgroundImage]; 105 | [self addSubview:self.popoverBackgroundImageView]; 106 | 107 | self.arrowImageView = [[UIImageView alloc] init]; 108 | [self addSubview:self.arrowImageView]; 109 | } 110 | 111 | return self; 112 | } 113 | 114 | #pragma mark - Layout subviews 115 | 116 | -(void)layoutSubviews 117 | { 118 | [super layoutSubviews]; 119 | 120 | CGFloat popoverImageOriginX = 0; 121 | CGFloat popoverImageOriginY = 0; 122 | 123 | CGFloat popoverImageWidth = self.bounds.size.width; 124 | CGFloat popoverImageHeight = self.bounds.size.height; 125 | 126 | CGFloat arrowImageOriginX = 0; 127 | CGFloat arrowImageOriginY = 0; 128 | 129 | CGFloat arrowImageWidth = ARROW_WIDTH; 130 | CGFloat arrowImageHeight = ARROW_HEIGHT; 131 | 132 | // Radius value you used to make rounded corners in your popover background image 133 | CGFloat cornerRadius = 9; 134 | 135 | switch (self.arrowDirection) { 136 | 137 | case UIPopoverArrowDirectionUp: 138 | 139 | popoverImageOriginY = ARROW_HEIGHT - 2; 140 | popoverImageHeight = self.bounds.size.height - ARROW_HEIGHT; 141 | 142 | // Calculating arrow x position using arrow offset, arrow width and popover width 143 | arrowImageOriginX = roundf((self.bounds.size.width - ARROW_WIDTH) / 2 + self.arrowOffset); 144 | 145 | // If arrow image exceeds rounded corner arrow image x postion is adjusted 146 | arrowImageOriginX = MIN(arrowImageOriginX, self.bounds.size.width - ARROW_WIDTH - cornerRadius); 147 | arrowImageOriginX = MAX(arrowImageOriginX, cornerRadius); 148 | 149 | // Setting arrow image for current arrow direction 150 | self.arrowImageView.image = _topArrowImage; 151 | 152 | break; 153 | 154 | case UIPopoverArrowDirectionDown: 155 | 156 | popoverImageHeight = self.bounds.size.height - ARROW_HEIGHT + 2; 157 | 158 | arrowImageOriginX = roundf((self.bounds.size.width - ARROW_WIDTH) / 2 + self.arrowOffset); 159 | 160 | arrowImageOriginX = MIN(arrowImageOriginX, self.bounds.size.width - ARROW_WIDTH - cornerRadius); 161 | arrowImageOriginX = MAX(arrowImageOriginX, cornerRadius); 162 | 163 | arrowImageOriginY = popoverImageHeight - 2; 164 | 165 | self.arrowImageView.image = _bottomArrowImage; 166 | 167 | break; 168 | 169 | case UIPopoverArrowDirectionLeft: 170 | 171 | popoverImageOriginX = ARROW_HEIGHT - 2; 172 | popoverImageWidth = self.bounds.size.width - ARROW_HEIGHT; 173 | 174 | arrowImageOriginY = roundf((self.bounds.size.height - ARROW_WIDTH) / 2 + self.arrowOffset); 175 | 176 | arrowImageOriginY = MIN(arrowImageOriginY, self.bounds.size.height - ARROW_WIDTH - cornerRadius); 177 | arrowImageOriginY = MAX(arrowImageOriginY, cornerRadius); 178 | 179 | arrowImageWidth = ARROW_HEIGHT; 180 | arrowImageHeight = ARROW_WIDTH; 181 | 182 | self.arrowImageView.image = _leftArrowImage; 183 | 184 | break; 185 | 186 | case UIPopoverArrowDirectionRight: 187 | 188 | popoverImageWidth = self.bounds.size.width - ARROW_HEIGHT + 2; 189 | 190 | arrowImageOriginX = popoverImageWidth - 2; 191 | arrowImageOriginY = roundf((self.bounds.size.height - ARROW_WIDTH) / 2 + self.arrowOffset); 192 | 193 | arrowImageOriginY = MIN(arrowImageOriginY, self.bounds.size.height - ARROW_WIDTH - cornerRadius); 194 | arrowImageOriginY = MAX(arrowImageOriginY, cornerRadius); 195 | 196 | arrowImageWidth = ARROW_HEIGHT; 197 | arrowImageHeight = ARROW_WIDTH; 198 | 199 | self.arrowImageView.image = _rightArrowImage; 200 | 201 | break; 202 | 203 | default: 204 | 205 | // For popovers without arrows (Thanks Martin!) 206 | popoverImageHeight = self.bounds.size.height - ARROW_HEIGHT + 2; 207 | 208 | break; 209 | } 210 | 211 | self.popoverBackgroundImageView.frame = CGRectMake(popoverImageOriginX, popoverImageOriginY, popoverImageWidth, popoverImageHeight); 212 | self.arrowImageView.frame = CGRectMake(arrowImageOriginX, arrowImageOriginY, arrowImageWidth, arrowImageHeight); 213 | } 214 | 215 | @end 216 | -------------------------------------------------------------------------------- /KSCustomPopover.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 32A935B814E87B2A00A27D6C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A935B714E87B2A00A27D6C /* UIKit.framework */; }; 11 | 32A935BA14E87B2A00A27D6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A935B914E87B2A00A27D6C /* Foundation.framework */; }; 12 | 32A935BC14E87B2A00A27D6C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A935BB14E87B2A00A27D6C /* CoreGraphics.framework */; }; 13 | 32A935C214E87B2A00A27D6C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 32A935C014E87B2A00A27D6C /* InfoPlist.strings */; }; 14 | 32A935C414E87B2A00A27D6C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935C314E87B2A00A27D6C /* main.m */; }; 15 | 32A935C814E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */; }; 16 | 32A935CB14E87B2A00A27D6C /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */; }; 17 | 32A935CE14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */; }; 18 | 32A935D114E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935D014E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m */; }; 19 | 32CFCBF814EB2B930044EF7A /* KSCustomPopoverBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CFCBF714EB2B920044EF7A /* KSCustomPopoverBackgroundView.m */; }; 20 | 32CFCC0014EB2CA50044EF7A /* popover-black-bcg-image.png in Resources */ = {isa = PBXBuildFile; fileRef = 32CFCBFB14EB2CA50044EF7A /* popover-black-bcg-image.png */; }; 21 | 32CFCC0114EB2CA50044EF7A /* popover-black-bottom-arrow-image.png in Resources */ = {isa = PBXBuildFile; fileRef = 32CFCBFC14EB2CA50044EF7A /* popover-black-bottom-arrow-image.png */; }; 22 | 32CFCC0214EB2CA50044EF7A /* popover-black-left-arrow-image.png in Resources */ = {isa = PBXBuildFile; fileRef = 32CFCBFD14EB2CA50044EF7A /* popover-black-left-arrow-image.png */; }; 23 | 32CFCC0314EB2CA50044EF7A /* popover-black-right-arrow-image.png in Resources */ = {isa = PBXBuildFile; fileRef = 32CFCBFE14EB2CA50044EF7A /* popover-black-right-arrow-image.png */; }; 24 | 32CFCC0414EB2CA50044EF7A /* popover-black-top-arrow-image.png in Resources */ = {isa = PBXBuildFile; fileRef = 32CFCBFF14EB2CA50044EF7A /* popover-black-top-arrow-image.png */; }; 25 | 32E7933B161A38860042A5D4 /* popover-black-top-arrow-image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 32E7933A161A38860042A5D4 /* popover-black-top-arrow-image@2x.png */; }; 26 | 32E7933D161A39600042A5D4 /* popover-black-bcg-image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 32E7933C161A39600042A5D4 /* popover-black-bcg-image@2x.png */; }; 27 | 32FDD2E2161A35D400C04F05 /* popover-black-right-arrow-image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DD161A35D400C04F05 /* popover-black-right-arrow-image@2x.png */; }; 28 | 32FDD2E3161A35D400C04F05 /* popover-black-left-arrow-image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DE161A35D400C04F05 /* popover-black-left-arrow-image@2x.png */; }; 29 | 32FDD2E4161A35D400C04F05 /* popover-black-bottom-arrow-image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DF161A35D400C04F05 /* popover-black-bottom-arrow-image@2x.png */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 32A935B314E87B2A00A27D6C /* KSCustomPopover.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KSCustomPopover.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 32A935B714E87B2A00A27D6C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 35 | 32A935B914E87B2A00A27D6C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 36 | 32A935BB14E87B2A00A27D6C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 37 | 32A935BF14E87B2A00A27D6C /* KSCustomPopover-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "KSCustomPopover-Info.plist"; sourceTree = ""; }; 38 | 32A935C114E87B2A00A27D6C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 39 | 32A935C314E87B2A00A27D6C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | 32A935C514E87B2A00A27D6C /* KSCustomPopover-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KSCustomPopover-Prefix.pch"; sourceTree = ""; }; 41 | 32A935C614E87B2A00A27D6C /* KSCustomPopoverAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverAppDelegate.h; sourceTree = ""; }; 42 | 32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverAppDelegate.m; sourceTree = ""; }; 43 | 32A935CA14E87B2A00A27D6C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 44 | 32A935CC14E87B2A00A27D6C /* KSCustomPopoverMainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverMainViewController.h; sourceTree = ""; }; 45 | 32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverMainViewController.m; sourceTree = ""; }; 46 | 32A935CF14E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverFlipsideViewController.h; sourceTree = ""; }; 47 | 32A935D014E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverFlipsideViewController.m; sourceTree = ""; }; 48 | 32CFCBF614EB2B920044EF7A /* KSCustomPopoverBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverBackgroundView.h; sourceTree = ""; }; 49 | 32CFCBF714EB2B920044EF7A /* KSCustomPopoverBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverBackgroundView.m; sourceTree = ""; }; 50 | 32CFCBFB14EB2CA50044EF7A /* popover-black-bcg-image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-bcg-image.png"; sourceTree = ""; }; 51 | 32CFCBFC14EB2CA50044EF7A /* popover-black-bottom-arrow-image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-bottom-arrow-image.png"; sourceTree = ""; }; 52 | 32CFCBFD14EB2CA50044EF7A /* popover-black-left-arrow-image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-left-arrow-image.png"; sourceTree = ""; }; 53 | 32CFCBFE14EB2CA50044EF7A /* popover-black-right-arrow-image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-right-arrow-image.png"; sourceTree = ""; }; 54 | 32CFCBFF14EB2CA50044EF7A /* popover-black-top-arrow-image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-top-arrow-image.png"; sourceTree = ""; }; 55 | 32E7933A161A38860042A5D4 /* popover-black-top-arrow-image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-top-arrow-image@2x.png"; sourceTree = ""; }; 56 | 32E7933C161A39600042A5D4 /* popover-black-bcg-image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-bcg-image@2x.png"; sourceTree = ""; }; 57 | 32FDD2DD161A35D400C04F05 /* popover-black-right-arrow-image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-right-arrow-image@2x.png"; sourceTree = ""; }; 58 | 32FDD2DE161A35D400C04F05 /* popover-black-left-arrow-image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-left-arrow-image@2x.png"; sourceTree = ""; }; 59 | 32FDD2DF161A35D400C04F05 /* popover-black-bottom-arrow-image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "popover-black-bottom-arrow-image@2x.png"; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 32A935B014E87B2A00A27D6C /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 32A935B814E87B2A00A27D6C /* UIKit.framework in Frameworks */, 68 | 32A935BA14E87B2A00A27D6C /* Foundation.framework in Frameworks */, 69 | 32A935BC14E87B2A00A27D6C /* CoreGraphics.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 3293D48314ED239A004BF851 /* Custom Popover Bacground View */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 32CFCBF614EB2B920044EF7A /* KSCustomPopoverBackgroundView.h */, 80 | 32CFCBF714EB2B920044EF7A /* KSCustomPopoverBackgroundView.m */, 81 | ); 82 | name = "Custom Popover Bacground View"; 83 | sourceTree = ""; 84 | }; 85 | 32A935A814E87B2A00A27D6C = { 86 | isa = PBXGroup; 87 | children = ( 88 | 32A935BD14E87B2A00A27D6C /* KSCustomPopover */, 89 | 32A935B614E87B2A00A27D6C /* Frameworks */, 90 | 32A935B414E87B2A00A27D6C /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 32A935B414E87B2A00A27D6C /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 32A935B314E87B2A00A27D6C /* KSCustomPopover.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 32A935B614E87B2A00A27D6C /* Frameworks */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 32A935B714E87B2A00A27D6C /* UIKit.framework */, 106 | 32A935B914E87B2A00A27D6C /* Foundation.framework */, 107 | 32A935BB14E87B2A00A27D6C /* CoreGraphics.framework */, 108 | ); 109 | name = Frameworks; 110 | sourceTree = ""; 111 | }; 112 | 32A935BD14E87B2A00A27D6C /* KSCustomPopover */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 32A935C614E87B2A00A27D6C /* KSCustomPopoverAppDelegate.h */, 116 | 32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */, 117 | 32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */, 118 | 32A935CC14E87B2A00A27D6C /* KSCustomPopoverMainViewController.h */, 119 | 32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */, 120 | 32A935CF14E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.h */, 121 | 32A935D014E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m */, 122 | 3293D48314ED239A004BF851 /* Custom Popover Bacground View */, 123 | 32A935BE14E87B2A00A27D6C /* Supporting Files */, 124 | ); 125 | path = KSCustomPopover; 126 | sourceTree = ""; 127 | }; 128 | 32A935BE14E87B2A00A27D6C /* Supporting Files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 32CFCBFA14EB2C840044EF7A /* Images */, 132 | 32A935BF14E87B2A00A27D6C /* KSCustomPopover-Info.plist */, 133 | 32A935C014E87B2A00A27D6C /* InfoPlist.strings */, 134 | 32A935C314E87B2A00A27D6C /* main.m */, 135 | 32A935C514E87B2A00A27D6C /* KSCustomPopover-Prefix.pch */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | 32CFCBFA14EB2C840044EF7A /* Images */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 32CFCBFC14EB2CA50044EF7A /* popover-black-bottom-arrow-image.png */, 144 | 32CFCBFD14EB2CA50044EF7A /* popover-black-left-arrow-image.png */, 145 | 32CFCBFE14EB2CA50044EF7A /* popover-black-right-arrow-image.png */, 146 | 32CFCBFF14EB2CA50044EF7A /* popover-black-top-arrow-image.png */, 147 | 32CFCBFB14EB2CA50044EF7A /* popover-black-bcg-image.png */, 148 | 32E7933A161A38860042A5D4 /* popover-black-top-arrow-image@2x.png */, 149 | 32FDD2DD161A35D400C04F05 /* popover-black-right-arrow-image@2x.png */, 150 | 32FDD2DE161A35D400C04F05 /* popover-black-left-arrow-image@2x.png */, 151 | 32FDD2DF161A35D400C04F05 /* popover-black-bottom-arrow-image@2x.png */, 152 | 32E7933C161A39600042A5D4 /* popover-black-bcg-image@2x.png */, 153 | ); 154 | name = Images; 155 | sourceTree = ""; 156 | }; 157 | /* End PBXGroup section */ 158 | 159 | /* Begin PBXNativeTarget section */ 160 | 32A935B214E87B2A00A27D6C /* KSCustomPopover */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 32A935D414E87B2A00A27D6C /* Build configuration list for PBXNativeTarget "KSCustomPopover" */; 163 | buildPhases = ( 164 | 32A935AF14E87B2A00A27D6C /* Sources */, 165 | 32A935B014E87B2A00A27D6C /* Frameworks */, 166 | 32A935B114E87B2A00A27D6C /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = KSCustomPopover; 173 | productName = KSCustomPopover; 174 | productReference = 32A935B314E87B2A00A27D6C /* KSCustomPopover.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | /* End PBXNativeTarget section */ 178 | 179 | /* Begin PBXProject section */ 180 | 32A935AA14E87B2A00A27D6C /* Project object */ = { 181 | isa = PBXProject; 182 | attributes = { 183 | LastUpgradeCheck = 0430; 184 | }; 185 | buildConfigurationList = 32A935AD14E87B2A00A27D6C /* Build configuration list for PBXProject "KSCustomPopover" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | ); 192 | mainGroup = 32A935A814E87B2A00A27D6C; 193 | productRefGroup = 32A935B414E87B2A00A27D6C /* Products */; 194 | projectDirPath = ""; 195 | projectRoot = ""; 196 | targets = ( 197 | 32A935B214E87B2A00A27D6C /* KSCustomPopover */, 198 | ); 199 | }; 200 | /* End PBXProject section */ 201 | 202 | /* Begin PBXResourcesBuildPhase section */ 203 | 32A935B114E87B2A00A27D6C /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 32A935C214E87B2A00A27D6C /* InfoPlist.strings in Resources */, 208 | 32A935CB14E87B2A00A27D6C /* MainStoryboard.storyboard in Resources */, 209 | 32CFCC0014EB2CA50044EF7A /* popover-black-bcg-image.png in Resources */, 210 | 32CFCC0114EB2CA50044EF7A /* popover-black-bottom-arrow-image.png in Resources */, 211 | 32CFCC0214EB2CA50044EF7A /* popover-black-left-arrow-image.png in Resources */, 212 | 32CFCC0314EB2CA50044EF7A /* popover-black-right-arrow-image.png in Resources */, 213 | 32CFCC0414EB2CA50044EF7A /* popover-black-top-arrow-image.png in Resources */, 214 | 32FDD2E2161A35D400C04F05 /* popover-black-right-arrow-image@2x.png in Resources */, 215 | 32FDD2E3161A35D400C04F05 /* popover-black-left-arrow-image@2x.png in Resources */, 216 | 32FDD2E4161A35D400C04F05 /* popover-black-bottom-arrow-image@2x.png in Resources */, 217 | 32E7933B161A38860042A5D4 /* popover-black-top-arrow-image@2x.png in Resources */, 218 | 32E7933D161A39600042A5D4 /* popover-black-bcg-image@2x.png in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 32A935AF14E87B2A00A27D6C /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 32A935C414E87B2A00A27D6C /* main.m in Sources */, 230 | 32A935C814E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m in Sources */, 231 | 32A935CE14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m in Sources */, 232 | 32A935D114E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m in Sources */, 233 | 32CFCBF814EB2B930044EF7A /* KSCustomPopoverBackgroundView.m in Sources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXSourcesBuildPhase section */ 238 | 239 | /* Begin PBXVariantGroup section */ 240 | 32A935C014E87B2A00A27D6C /* InfoPlist.strings */ = { 241 | isa = PBXVariantGroup; 242 | children = ( 243 | 32A935C114E87B2A00A27D6C /* en */, 244 | ); 245 | name = InfoPlist.strings; 246 | sourceTree = ""; 247 | }; 248 | 32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */ = { 249 | isa = PBXVariantGroup; 250 | children = ( 251 | 32A935CA14E87B2A00A27D6C /* en */, 252 | ); 253 | name = MainStoryboard.storyboard; 254 | sourceTree = ""; 255 | }; 256 | /* End PBXVariantGroup section */ 257 | 258 | /* Begin XCBuildConfiguration section */ 259 | 32A935D214E87B2A00A27D6C /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ALWAYS_SEARCH_USER_PATHS = NO; 263 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 264 | CLANG_ENABLE_OBJC_ARC = YES; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_DYNAMIC_NO_PIC = NO; 269 | GCC_OPTIMIZATION_LEVEL = 0; 270 | GCC_PREPROCESSOR_DEFINITIONS = ( 271 | "DEBUG=1", 272 | "$(inherited)", 273 | ); 274 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 275 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 276 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 277 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 280 | SDKROOT = iphoneos; 281 | TARGETED_DEVICE_FAMILY = 2; 282 | }; 283 | name = Debug; 284 | }; 285 | 32A935D314E87B2A00A27D6C /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ALWAYS_SEARCH_USER_PATHS = NO; 289 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 290 | CLANG_ENABLE_OBJC_ARC = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = YES; 293 | GCC_C_LANGUAGE_STANDARD = gnu99; 294 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 295 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 296 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 299 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 300 | SDKROOT = iphoneos; 301 | TARGETED_DEVICE_FAMILY = 2; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Release; 305 | }; 306 | 32A935D514E87B2A00A27D6C /* Debug */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 310 | GCC_PREFIX_HEADER = "KSCustomPopover/KSCustomPopover-Prefix.pch"; 311 | INFOPLIST_FILE = "KSCustomPopover/KSCustomPopover-Info.plist"; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | WRAPPER_EXTENSION = app; 314 | }; 315 | name = Debug; 316 | }; 317 | 32A935D614E87B2A00A27D6C /* Release */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 321 | GCC_PREFIX_HEADER = "KSCustomPopover/KSCustomPopover-Prefix.pch"; 322 | INFOPLIST_FILE = "KSCustomPopover/KSCustomPopover-Info.plist"; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | WRAPPER_EXTENSION = app; 325 | }; 326 | name = Release; 327 | }; 328 | /* End XCBuildConfiguration section */ 329 | 330 | /* Begin XCConfigurationList section */ 331 | 32A935AD14E87B2A00A27D6C /* Build configuration list for PBXProject "KSCustomPopover" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 32A935D214E87B2A00A27D6C /* Debug */, 335 | 32A935D314E87B2A00A27D6C /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | 32A935D414E87B2A00A27D6C /* Build configuration list for PBXNativeTarget "KSCustomPopover" */ = { 341 | isa = XCConfigurationList; 342 | buildConfigurations = ( 343 | 32A935D514E87B2A00A27D6C /* Debug */, 344 | 32A935D614E87B2A00A27D6C /* Release */, 345 | ); 346 | defaultConfigurationIsVisible = 0; 347 | defaultConfigurationName = Release; 348 | }; 349 | /* End XCConfigurationList section */ 350 | }; 351 | rootObject = 32A935AA14E87B2A00A27D6C /* Project object */; 352 | } 353 | --------------------------------------------------------------------------------