Skip to content

Commit bc2a350

Browse files
Merge pull request #28 from Snupps/master
Conditional compiling of iOS 7 only features by Andrea Bizzotto
2 parents f9a80b4 + 012ce8b commit bc2a350

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

WYPopoverController/WYPopoverController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverArrowDirection) {
4646

4747
@interface WYPopoverBackgroundView : UIView
4848

49-
@property (nonatomic, strong) UIColor *strokeColor UI_APPEARANCE_SELECTOR DEPRECATED_MSG_ATTRIBUTE("WYPopoverController [0.1.3] : Use 'outerStrokeColor' instead.");
49+
@property (nonatomic, strong) UIColor *strokeColor UI_APPEARANCE_SELECTOR __attribute((deprecated("WYPopoverController [0.1.3] : Use 'outerStrokeColor' instead.")));
5050

5151
@property (nonatomic, strong) UIColor *tintColor UI_APPEARANCE_SELECTOR;
5252
@property (nonatomic, strong) UIColor *fillTopColor UI_APPEARANCE_SELECTOR;

WYPopoverController/WYPopoverController.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ of this software and associated documentation files (the "Software"), to deal
2525

2626
#import "WYPopoverController.h"
2727

28+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
29+
#define WY_BASE_SDK_7_ENABLED
30+
#endif
31+
2832
#ifdef DEBUG
2933
#define WY_LOG(fmt, ...) NSLog((@"%s (%d) : " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
3034
#else
@@ -1316,11 +1320,13 @@ - (CGSize)popoverContentSize
13161320
{
13171321
CGSize result = CGSizeZero;
13181322

1323+
#ifdef WY_BASE_SDK_7_ENABLED
13191324
if ([viewController respondsToSelector:@selector(preferredContentSize)])
13201325
{
13211326
result = [viewController preferredContentSize];
13221327
}
13231328
else
1329+
#endif
13241330
{
13251331
#pragma clang diagnostic push
13261332
#pragma GCC diagnostic ignored "-Wdeprecated"
@@ -1333,11 +1339,13 @@ - (CGSize)popoverContentSize
13331339

13341340
- (void)setPopoverContentSize:(CGSize)size
13351341
{
1342+
#ifdef WY_BASE_SDK_7_ENABLED
13361343
if ([viewController respondsToSelector:@selector(setPreferredContentSize:)])
13371344
{
13381345
[viewController setPreferredContentSize:size];
13391346
}
13401347
else
1348+
#endif
13411349
{
13421350
#pragma clang diagnostic push
13431351
#pragma GCC diagnostic ignored "-Wdeprecated"
@@ -1352,11 +1360,12 @@ - (CGSize)contentSizeForViewInPopover
13521360
{
13531361
CGSize result = CGSizeZero;
13541362

1363+
#ifdef WY_BASE_SDK_7_ENABLED
13551364
if ([viewController respondsToSelector:@selector(preferredContentSize)])
13561365
{
13571366
result = viewController.preferredContentSize;
13581367
}
1359-
1368+
#endif
13601369
if (CGSizeEqualToSize(result, CGSizeZero))
13611370
{
13621371
#pragma clang diagnostic push

0 commit comments

Comments
 (0)