Skip to content
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

does it work on xcode6 & ios8.2 now? #5

Open
sunuslee opened this issue Apr 2, 2015 · 7 comments
Open

does it work on xcode6 & ios8.2 now? #5

sunuslee opened this issue Apr 2, 2015 · 7 comments
Labels

Comments

@sunuslee
Copy link

sunuslee commented Apr 2, 2015

hi, i just use this simple code to test, but get no warnings:
my baseSDK is ios8.2 and deployment target is 6.0..

UIView *testView = [[UIView alloc] initWithFrame:self.window.bounds];
[testView setLayoutMargins:UIEdgeInsetsZero];

i think the setLayoutMagins , should be introduced in ios8.

@property (nonatomic) BOOL preservesSuperviewLayoutMargins NS_AVAILABLE_IOS(8_0);

is there something i need to be noticed?
thanks!

@rivera-ernesto
Copy link
Contributor

You make this #define just before importing NBUAvailability.h.

We may need to add entries for 8.2 and 8.3 in the bottom of that file though.

@sunuslee
Copy link
Author

sunuslee commented Apr 3, 2015

i tried, it didn't give me any warnings.
are you sure this work?

also, i am putting another some test program here, still, strange.

could you please clone that repo and tell me what's going on? thanks!

https://github.com/sunuslee/macapi-tester

@sunuslee
Copy link
Author

sunuslee commented Apr 3, 2015

it turn out to be the same situation like (https://github.com/sunuslee/macapi-tester) when i add

#if __IPHONE_OS_VERSION_SOFT_MAX_REQUIRED < __IPHONE_8_2
    #undef __AVAILABILITY_INTERNAL__IPHONE_8_2
    #define __AVAILABILITY_INTERNAL__IPHONE_8_2 __NBU_AVAILABILITY_STARTING("8.2")
    #define __NBU_APICHECK_8_2(_ios)            __NBU_AVAILABILITY_STARTING("8.2")
#else
    #define __NBU_APICHECK_8_2(_ios)            CF_AVAILABLE_IOS(_ios)
#endif

to this file, then, in my class(AppDelegate)

add a property (same as UIView)
@Property (nonatomic) UIEdgeInsets layoutMargins NS_AVAILABLE_IOS(8_0);

then,

[self setLayoutMargins:UIEdgeInsetsZero];

gets the right warning.

screen shot 2015-04-03 at 11 51 58 am

but no luck for

UIView *testView = [[UIView alloc] initWithFrame:self.window.bounds];
[testView setLayoutMargins:UIEdgeInsetsZero];

@rivera-ernesto
Copy link
Contributor

Did you try adding the entries for 8.1 ~ .3 to NBUAvailability.h?

@sunuslee
Copy link
Author

sunuslee commented Apr 8, 2015

yeah, it turned out that, i have to set enable_module to NO, so that those macros can work.

@rivera-ernesto
Copy link
Contributor

Nice. Could you pull request your changes?

@rivera-ernesto
Copy link
Contributor

I updated the library and set enable_module to NO but still macros don't show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants