Suppress specific deprecations

In earlier version of Xcode we could use clang pragmas to suppress deprecated method warnings. How do we do that with lldb/Xcode 7? I've got some code that uses UIActionSheet and for various reasons it's just going to be a long time before I can rewrite with UIAlertController as it's pretty complex code, and the client doesn't want it touched right now.

Answered by Frameworks Engineer in 59357022

The same pragmas you may have used in the past should continue to work – nothing has changed here.

Accepted Answer

The same pragmas you may have used in the past should continue to work – nothing has changed here.

I was trying to use the below to silece a warning about a deprecated method as well as deprecated declarations, which was why I thought it wasn't working at first.

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

I'm having the exact same problem. With Xcode 7 the following #pragmas do nothing. I get the documentation warnings. In Xcode 6 they were supressed with the exact same project.


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#import "SwiftToObjectiveC-Swift.h"
#pragma clang diagnostic pop


Anyone knows what is the difference here?

Suppress specific deprecations
 
 
Q