To provide a fallback language for NSLocalizedString
, I'm using this #undef
and #define
in Objective-C:
#undef NSLocalizedString
#define NSLocalizedString(key, comment) @"NSLocalizedString has been replaced";
This works perfectly well if called from Objective-C, but if called from Swift, the new definition of NSLocalizedString
is ignored. (bridging header is configured correctly and works)
Is this possible in Swift, and if so, how?
Note: the real example is here on Github, also see SO answer here
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…