How i can use global constants like:
#define EXAMPLE 123
from Objective-C in Swift???
I need to use string constants, which must be defined in AppDelegate to use in all App with #include "AppDelegate.h"
in each class files.
How i can use global constants like:
#define EXAMPLE 123
from Objective-C in Swift???
I need to use string constants, which must be defined in AppDelegate to use in all App with #include "AppDelegate.h"
in each class files.
I suggest making a structure, in a seperate file, with its properties as let
constants. So something like this
struct myConstants {
static let firstConstant = "hello"
static let secondConstant = "goodbye"
}
Just create a Struct class
and make each property/function static
.
struct Global {
static var test = "Some value"
}
Call it Global.test