Skip to content

Commit ace8e75

Browse files
added use of quartzcore framework in order to improve performance
1 parent cc97496 commit ace8e75

14 files changed

Lines changed: 252 additions & 169 deletions

File tree

WYPopoverController.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
Pod::Spec.new do |s|
22
s.name = "WYPopoverController"
3-
s.version = "0.1.1"
3+
s.version = "0.1.2"
44
s.summary = "An iOS Popover for iPhone and iPad. Very customizable."
55
s.description = <<-DESC
66
WYPopoverController is for the presentation of content in popover on iPhone / iPad devices. Very customizable.
77
DESC
88
s.homepage = "https://github.com/nicolaschengdev/WYPopoverController"
99
s.license = { :type => 'MIT', :file => 'LICENSE' }
1010
s.author = { "Nicolas CHENG" => "nicolas.cheng.dev@gmail.com" }
11-
s.source = { :git => "https://github.com/nicolaschengdev/WYPopoverController.git", :tag => "0.1.1" }
11+
s.source = { :git => "https://github.com/nicolaschengdev/WYPopoverController.git", :tag => "0.1.2" }
1212
s.platform = :ios, '5.0'
1313
s.source_files = 'WYPopoverController/*.{h,m}'
1414
s.requires_arc = true
15+
s.frameworks = 'QuartzCore', 'UIKit'
1516
end

WYPopoverController/WYPopoverController.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version 0.1.1
2+
Version 0.1.2
33
44
WYPopoverController is available under the MIT license.
55
@@ -28,7 +28,7 @@
2828
#define WYPOPOVER_DEFAULT_TINT_COLOR [UIColor colorWithRed:55.f/255.f green:63.f/255.f blue:71.f/255.f alpha:1.f]
2929
#define WYPOPOVER_DEFAULT_OVERLAY_COLOR [UIColor clearColor]
3030
#define WYPOPOVER_DEFAULT_ANIMATION_DURATION 0.20f
31-
#define WYPOPOVER_MIN_POPOVER_SIZE CGSizeMake(200, 200)
31+
#define WYPOPOVER_MIN_POPOVER_SIZE CGSizeMake(200, 100)
3232

3333
typedef NS_OPTIONS(NSUInteger, WYPopoverArrowDirection) {
3434
WYPopoverArrowDirectionUp = 1UL << 0,
@@ -63,6 +63,7 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverArrowDirection) {
6363
@property (nonatomic, assign) CGFloat outerShadowBlurRadius UI_APPEARANCE_SELECTOR;
6464
@property (nonatomic, assign) CGSize outerShadowOffset UI_APPEARANCE_SELECTOR;
6565
@property (nonatomic, assign) CGFloat outerCornerRadius UI_APPEARANCE_SELECTOR;
66+
@property (nonatomic, assign) CGFloat minOuterCornerRadius UI_APPEARANCE_SELECTOR;
6667

6768
@property (nonatomic, strong) UIColor *innerShadowColor UI_APPEARANCE_SELECTOR;
6869
@property (nonatomic, assign) CGFloat innerShadowBlurRadius UI_APPEARANCE_SELECTOR;

WYPopoverController/WYPopoverController.m

Lines changed: 208 additions & 136 deletions
Large diffs are not rendered by default.

WYPopoverController/WYStoryboardPopoverSegue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version 0.1.1
2+
Version 0.1.2
33
44
WYPopoverController is available under the MIT license.
55

WYPopoverController/WYStoryboardPopoverSegue.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version 0.1.1
2+
Version 0.1.2
33
44
WYPopoverController is available under the MIT license.
55

demos/Demo/WYPopoverDemo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
976A344B17BBAA4C0071BF21 /* WYSettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 976A344917BBAA4C0071BF21 /* WYSettingsViewController.xib */; };
2727
97B3CB2F17CD57910005E1A1 /* WYAnotherViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97B3CB2D17CD57910005E1A1 /* WYAnotherViewController.m */; };
2828
97C0779F17D3C2DF006A19CE /* WYAnotherViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 97C0779E17D3C2DF006A19CE /* WYAnotherViewController.xib */; };
29+
97F27C8E17DB4F8800D5D4A2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97FA5C3917D1B11100F611A0 /* QuartzCore.framework */; };
2930
97FA5C3017D1A82E00F611A0 /* WYPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97FA5C2D17D1A82E00F611A0 /* WYPopoverController.m */; };
3031
97FA5C3117D1A82E00F611A0 /* WYStoryboardPopoverSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 97FA5C2F17D1A82E00F611A0 /* WYStoryboardPopoverSegue.m */; };
3132
/* End PBXBuildFile section */
@@ -69,6 +70,7 @@
6970
isa = PBXFrameworksBuildPhase;
7071
buildActionMask = 2147483647;
7172
files = (
73+
97F27C8E17DB4F8800D5D4A2 /* QuartzCore.framework in Frameworks */,
7274
976A341F17BB9AEB0071BF21 /* UIKit.framework in Frameworks */,
7375
976A342117BB9AEB0071BF21 /* Foundation.framework in Frameworks */,
7476
976A342317BB9AEB0071BF21 /* CoreGraphics.framework in Frameworks */,

demos/Demo/WYPopoverDemo/WYAppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2222
WYPopoverBackgroundView* popoverAppearance = [WYPopoverBackgroundView appearance];
2323
[popoverAppearance setTintColor:[UIColor whiteColor]];
2424

25-
[popoverAppearance setOuterCornerRadius:5];
25+
[popoverAppearance setOuterCornerRadius:20];
2626
[popoverAppearance setOuterShadowBlurRadius:6];
2727
[popoverAppearance setOuterShadowColor:[UIColor colorWithWhite:0 alpha:0.65]];
2828
[popoverAppearance setOuterShadowOffset:CGSizeMake(0, 2)];

demos/Demo/WYPopoverDemo/WYPopoverDemo-Prefix.pch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
#import <UIKit/UIKit.h>
1414
#import <Foundation/Foundation.h>
15-
//#import <QuartzCore/QuartzCore.h>
15+
#import <QuartzCore/QuartzCore.h>
1616

1717
#endif

demos/DemoSegue/WYPopoverDemoSegue.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
97D6944417D51E000035D292 /* WYTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97D6944217D51E000035D292 /* WYTestViewController.m */; };
5454
97D6944517D51E000035D292 /* WYTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 97D6944317D51E000035D292 /* WYTestViewController.xib */; };
5555
97D6945517D54BC00035D292 /* WYGesturesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97D6945417D54BC00035D292 /* WYGesturesViewController.m */; };
56+
97F27C8D17DA729000D5D4A2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97F27C8C17DA729000D5D4A2 /* QuartzCore.framework */; };
5657
/* End PBXBuildFile section */
5758

5859
/* Begin PBXFileReference section */
@@ -115,13 +116,15 @@
115116
97D6944317D51E000035D292 /* WYTestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WYTestViewController.xib; sourceTree = "<group>"; };
116117
97D6945317D54BC00035D292 /* WYGesturesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYGesturesViewController.h; sourceTree = "<group>"; };
117118
97D6945417D54BC00035D292 /* WYGesturesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYGesturesViewController.m; sourceTree = "<group>"; };
119+
97F27C8C17DA729000D5D4A2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
118120
/* End PBXFileReference section */
119121

120122
/* Begin PBXFrameworksBuildPhase section */
121123
97B3CB3717CDE8E50005E1A1 /* Frameworks */ = {
122124
isa = PBXFrameworksBuildPhase;
123125
buildActionMask = 2147483647;
124126
files = (
127+
97F27C8D17DA729000D5D4A2 /* QuartzCore.framework in Frameworks */,
125128
97B3CB3E17CDE8E50005E1A1 /* UIKit.framework in Frameworks */,
126129
97B3CB4017CDE8E50005E1A1 /* Foundation.framework in Frameworks */,
127130
97B3CB4217CDE8E50005E1A1 /* CoreGraphics.framework in Frameworks */,
@@ -151,6 +154,7 @@
151154
97B3CB3C17CDE8E50005E1A1 /* Frameworks */ = {
152155
isa = PBXGroup;
153156
children = (
157+
97F27C8C17DA729000D5D4A2 /* QuartzCore.framework */,
154158
97B3CB3D17CDE8E50005E1A1 /* UIKit.framework */,
155159
97B3CB3F17CDE8E50005E1A1 /* Foundation.framework */,
156160
97B3CB4117CDE8E50005E1A1 /* CoreGraphics.framework */,

demos/DemoSegue/WYPopoverDemoSegue/WYAppDelegate.m

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ @implementation WYAppDelegate
1515

1616
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
1717
{
18-
//WYPopoverBackgroundView* popoverAppearance = [WYPopoverBackgroundView appearance];
18+
WYPopoverBackgroundView* popoverAppearance = [WYPopoverBackgroundView appearance];
19+
20+
[popoverAppearance setTintColor:[UIColor colorWithRed:63./255. green:92./255. blue:128./255. alpha:1]];
1921

20-
//[popoverAppearance setOuterCornerRadius:8];
21-
//[popoverAppearance setInnerCornerRadius:6];
22+
[popoverAppearance setOuterCornerRadius:6];
23+
[popoverAppearance setMinOuterCornerRadius:2];
24+
[popoverAppearance setInnerCornerRadius:4];
2225

23-
/*
24-
[popoverAppearance setBorderWidth:12];
25-
[popoverAppearance setArrowBase:40];
26-
[popoverAppearance setArrowHeight:20];
26+
[popoverAppearance setBorderWidth:6];
27+
[popoverAppearance setArrowBase:32];
28+
[popoverAppearance setArrowHeight:14];
2729

28-
[popoverAppearance setGlossShadowColor:[UIColor lightGrayColor]];
29-
[popoverAppearance setGlossShadowOffset:CGSizeMake(0, 1)];
30+
[popoverAppearance setGlossShadowColor:[UIColor colorWithWhite:1 alpha:0.5]];
31+
[popoverAppearance setGlossShadowBlurRadius:1];
32+
[popoverAppearance setGlossShadowOffset:CGSizeMake(0, 1.5)];
3033

31-
[popoverAppearance setOuterShadowColor:[UIColor colorWithWhite:0 alpha:0.75]];
32-
[popoverAppearance setOuterShadowBlurRadius:10];
33-
[popoverAppearance setOuterShadowOffset:CGSizeMake(0, 0)];
34+
[popoverAppearance setOuterShadowColor:[UIColor colorWithRed:16./255. green:50./255. blue:82./255. alpha:1]];
35+
[popoverAppearance setOuterShadowBlurRadius:8];
36+
[popoverAppearance setOuterShadowOffset:CGSizeMake(0, 2)];
3437

35-
[popoverAppearance setInnerShadowColor:[UIColor colorWithWhite:0 alpha:0.75]];
38+
[popoverAppearance setInnerShadowColor:[UIColor colorWithWhite:0 alpha:1]];
3639
[popoverAppearance setInnerShadowBlurRadius:3];
37-
[popoverAppearance setInnerShadowOffset:CGSizeMake(0, 1)];
38-
*/
40+
[popoverAppearance setInnerShadowOffset:CGSizeMake(0, 0.5)];
3941

40-
/*
41-
UINavigationBar* navBarAppearance = [UINavigationBar appearanceWhenContainedIn:[WYPopoverBackgroundView class], [UINavigationController class], nil];
42+
UINavigationBar* navBarAppearance = [UINavigationBar appearanceWhenContainedIn:[UINavigationController class], [WYPopoverBackgroundView class], nil];
4243
[navBarAppearance setTitleTextAttributes:@{
43-
UITextAttributeTextColor : [UIColor darkGrayColor],
44-
UITextAttributeTextShadowColor: [UIColor whiteColor],
44+
UITextAttributeTextColor : [UIColor whiteColor],
45+
UITextAttributeTextShadowColor: [UIColor colorWithWhite:0 alpha:0.8],
4546
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, -1)]
4647
}];
47-
*/
4848

4949
NSArray *temp = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"players" ofType:@"plist"]];
5050

0 commit comments

Comments
 (0)