Skip to content

cleanup (autosynthesized properties, no ivars, removed unused methods) and tweaked example project #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions KSCustomPopover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
32A935C214E87B2A00A27D6C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 32A935C014E87B2A00A27D6C /* InfoPlist.strings */; };
32A935C414E87B2A00A27D6C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935C314E87B2A00A27D6C /* main.m */; };
32A935C814E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */; };
32A935CB14E87B2A00A27D6C /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */; };
32A935CE14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */; };
32A935D114E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A935D014E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m */; };
32CFCBF814EB2B930044EF7A /* KSCustomPopoverBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CFCBF714EB2B920044EF7A /* KSCustomPopoverBackgroundView.m */; };
Expand All @@ -27,6 +26,8 @@
32FDD2E2161A35D400C04F05 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DD161A35D400C04F05 /* [email protected] */; };
32FDD2E3161A35D400C04F05 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DE161A35D400C04F05 /* [email protected] */; };
32FDD2E4161A35D400C04F05 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 32FDD2DF161A35D400C04F05 /* [email protected] */; };
D20B180016EE1FA900E801B9 /* KSCustomPopoverMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D20B17FF16EE1FA900E801B9 /* KSCustomPopoverMainViewController.xib */; };
D20B180216EE304500E801B9 /* KSCustomPopoverFlipsideViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D20B180116EE304500E801B9 /* KSCustomPopoverFlipsideViewController.xib */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -40,7 +41,6 @@
32A935C514E87B2A00A27D6C /* KSCustomPopover-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KSCustomPopover-Prefix.pch"; sourceTree = "<group>"; };
32A935C614E87B2A00A27D6C /* KSCustomPopoverAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverAppDelegate.h; sourceTree = "<group>"; };
32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverAppDelegate.m; sourceTree = "<group>"; };
32A935CA14E87B2A00A27D6C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
32A935CC14E87B2A00A27D6C /* KSCustomPopoverMainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverMainViewController.h; sourceTree = "<group>"; };
32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSCustomPopoverMainViewController.m; sourceTree = "<group>"; };
32A935CF14E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSCustomPopoverFlipsideViewController.h; sourceTree = "<group>"; };
Expand All @@ -57,6 +57,8 @@
32FDD2DD161A35D400C04F05 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
32FDD2DE161A35D400C04F05 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
32FDD2DF161A35D400C04F05 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D20B17FF16EE1FA900E801B9 /* KSCustomPopoverMainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KSCustomPopoverMainViewController.xib; sourceTree = "<group>"; };
D20B180116EE304500E801B9 /* KSCustomPopoverFlipsideViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KSCustomPopoverFlipsideViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -114,11 +116,12 @@
children = (
32A935C614E87B2A00A27D6C /* KSCustomPopoverAppDelegate.h */,
32A935C714E87B2A00A27D6C /* KSCustomPopoverAppDelegate.m */,
32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */,
32A935CC14E87B2A00A27D6C /* KSCustomPopoverMainViewController.h */,
32A935CD14E87B2A00A27D6C /* KSCustomPopoverMainViewController.m */,
D20B17FF16EE1FA900E801B9 /* KSCustomPopoverMainViewController.xib */,
32A935CF14E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.h */,
32A935D014E87B2A00A27D6C /* KSCustomPopoverFlipsideViewController.m */,
D20B180116EE304500E801B9 /* KSCustomPopoverFlipsideViewController.xib */,
3293D48314ED239A004BF851 /* Custom Popover Bacground View */,
32A935BE14E87B2A00A27D6C /* Supporting Files */,
);
Expand Down Expand Up @@ -205,7 +208,6 @@
buildActionMask = 2147483647;
files = (
32A935C214E87B2A00A27D6C /* InfoPlist.strings in Resources */,
32A935CB14E87B2A00A27D6C /* MainStoryboard.storyboard in Resources */,
32CFCC0014EB2CA50044EF7A /* popover-black-bcg-image.png in Resources */,
32CFCC0114EB2CA50044EF7A /* popover-black-bottom-arrow-image.png in Resources */,
32CFCC0214EB2CA50044EF7A /* popover-black-left-arrow-image.png in Resources */,
Expand All @@ -216,6 +218,8 @@
32FDD2E4161A35D400C04F05 /* [email protected] in Resources */,
32E7933B161A38860042A5D4 /* [email protected] in Resources */,
32E7933D161A39600042A5D4 /* [email protected] in Resources */,
D20B180016EE1FA900E801B9 /* KSCustomPopoverMainViewController.xib in Resources */,
D20B180216EE304500E801B9 /* KSCustomPopoverFlipsideViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -245,14 +249,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
32A935C914E87B2A00A27D6C /* MainStoryboard.storyboard */ = {
isa = PBXVariantGroup;
children = (
32A935CA14E87B2A00A27D6C /* en */,
);
name = MainStoryboard.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand All @@ -272,7 +268,6 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
Expand All @@ -291,7 +286,6 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
Expand Down
17 changes: 0 additions & 17 deletions KSCustomPopover/KSCustomPopoverAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@
// Created by Krzysztof Scianski on 12.02.2012.
// Copyright (c) 2012 Krzysztof Scianski. All rights reserved.
//
// 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.


#import <UIKit/UIKit.h>
Expand Down
62 changes: 4 additions & 58 deletions KSCustomPopover/KSCustomPopoverAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,20 @@
// Created by Krzysztof Scianski on 12.02.2012.
// Copyright (c) 2012 Krzysztof Scianski. All rights reserved.
//
// 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.

#import "KSCustomPopoverMainViewController.h"

#import "KSCustomPopoverAppDelegate.h"

@implementation KSCustomPopoverAppDelegate

@synthesize window = _window;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = [[KSCustomPopoverMainViewController alloc] init];

// Override point for customization after application launch.
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, this method is called instead of applicationWillTerminate: when the user quits.
*/
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
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.
*/
}

- (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.
Save data if appropriate.
See also applicationDidEnterBackground:.
*/
}

@end
37 changes: 2 additions & 35 deletions KSCustomPopover/KSCustomPopoverBackgroundView.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,10 @@
// Created by Krzysztof Scianski on 12.02.2012.
// Copyright (c) 2012 Krzysztof Scianski. All rights reserved.
//
// 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.


#import <UIKit/UIKit.h>
#import <UIKit/UIPopoverBackgroundView.h>

@interface KSCustomPopoverBackgroundView : UIPopoverBackgroundView
{
CGFloat _arrowOffset;
UIPopoverArrowDirection _arrowDirection;
UIImageView *_arrowImageView;
UIImageView *_popoverBackgroundImageView;
}

@property (nonatomic, readwrite) CGFloat arrowOffset;
@property (nonatomic, readwrite) UIPopoverArrowDirection arrowDirection;
@property (nonatomic, readwrite, strong) UIImageView *arrowImageView;
@property (nonatomic, readwrite, strong) UIImageView *popoverBackgroundImageView;

+ (CGFloat)arrowHeight;
+ (CGFloat)arrowBase;
+ (UIEdgeInsets)contentViewInsets;
@property (nonatomic, readonly) UIImageView *arrowImageView;
@property (nonatomic, readonly) UIImageView *backgroundImageView;

@end
Loading