Skip to content

Commit 012ce8b

Browse files
author
Andrea Bizzotto
committed
Conditional compiling of iOS 7 only features
1 parent 865044e commit 012ce8b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

WYPopoverController/WYPopoverController.m

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

2626
#import "WYPopoverController.h"
2727

28-
// TODO: Enable when ios 7 base sdk is enabled
29-
//#define COMPILE_WITH_IOS7_SUPPORT
28+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
29+
#define WY_BASE_SDK_7_ENABLED
30+
#endif
3031

3132
#ifdef DEBUG
3233
#define WY_LOG(fmt, ...) NSLog((@"%s (%d) : " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
@@ -1319,7 +1320,7 @@ - (CGSize)popoverContentSize
13191320
{
13201321
CGSize result = CGSizeZero;
13211322

1322-
#ifdef COMPILE_WITH_IOS7_SUPPORT
1323+
#ifdef WY_BASE_SDK_7_ENABLED
13231324
if ([viewController respondsToSelector:@selector(preferredContentSize)])
13241325
{
13251326
result = [viewController preferredContentSize];
@@ -1338,7 +1339,7 @@ - (CGSize)popoverContentSize
13381339

13391340
- (void)setPopoverContentSize:(CGSize)size
13401341
{
1341-
#ifdef COMPILE_WITH_IOS7_SUPPORT
1342+
#ifdef WY_BASE_SDK_7_ENABLED
13421343
if ([viewController respondsToSelector:@selector(setPreferredContentSize:)])
13431344
{
13441345
[viewController setPreferredContentSize:size];
@@ -1359,7 +1360,7 @@ - (CGSize)contentSizeForViewInPopover
13591360
{
13601361
CGSize result = CGSizeZero;
13611362

1362-
#ifdef COMPILE_WITH_IOS7_SUPPORT
1363+
#ifdef WY_BASE_SDK_7_ENABLED
13631364
if ([viewController respondsToSelector:@selector(preferredContentSize)])
13641365
{
13651366
result = viewController.preferredContentSize;

0 commit comments

Comments
 (0)