Reputation: 4755
I'm currently updating a library, and for users with iOS 7.0 and above, a certain method is deprecated.
I've implemented the following logic to use the correct methods:
if (SYSTEM_VERSION_LESS_THAN(@"7.0")) {
//Use old deprecated method
} else {
//Use the new method supported in 7.0
}
If I use the following in my if statement to silence the warning, and users ship this code in their apps will their apps be rejected or will it be okay?
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
//old deprecated method
#pragma clang diagnostic pop
Upvotes: 0
Views: 47
Reputation: 42588
To answer your question directly, until Apple removes support for an API, they will not reject it usage in an app.
Be careful modifying third party libraries. There are legal implications for modifying open source depending on the license.
Whenever possible, I modify the build system that compiles the third party code. For example, if I have the source files directly included in my project, then I will suppress the needed warnings for just those files.
-Wdeprecated-declarations
in Compiler Flags for the open source files.Upvotes: 1