I have an Objective-C class in a .h file similar to this:
@interface GlobalTags : NSObject
   extern const BOOL showMessages;
@end
and a .m file similar to this:
@implementation GlobalTags
   const BOOL showMessages = YES;
@end
In summary, what I want is to have several global variables with no need to instance a class, just to access them by importing their file. What is the best way to do this in Swift?
Thanks
EDIT: regarding getting Swift global variables from Objective-C code, it is not possible (see this post).
To make such global variables visible in Objective-C code, I'm doing this in the Swift file:
class GlobalTags: NSObject {
   static let showMessages: Bool = true;
}
Would this be the correct/best way to do?
 
     
     
    