I want to add warnings to some methods that have legacy code in both objective C and Swift , whenever these methods are used somewhere by other developers, I want them to be warned that they are using legacy code, it is not required to be shown as deprecated or obsolete I only need to warn them about it.
Eg. Let this be the function definition
func someLegacyMethod() {
#warning this is legacy code
// some function
}
When a user calls this method I want him to be warned. I thought of using swiftlint but couldn't find a way to do this because the definition is elsewhere and the calling place is elsewhere and this needs to be future proof because these methods can be used in many places in the future. I am open to exploring other ways to implement this too.
someLegacyMethod() //warning should appear here
Edit1: I found this: https://blog.twitter.com/engineering/en_us/a/2014/attribute-directives-in-objective-c and tried using attribute((warning(…))) but XCode is complaining : unknown attribute 'warning' ignored.