With Objective C, I used 'FileName.h' header file to declare all constants values with #default and it can be accessed from any other classes by importing the constants.h file.
In Swift: What is the alternate to that in swift?
With Objective C, I used 'FileName.h' header file to declare all constants values with #default and it can be accessed from any other classes by importing the constants.h file.
In Swift: What is the alternate to that in swift?
Make a Constants.swift file. Following file will help you. eg.:
class Constants: NSObject
{
static let msg = ""
static let text = ""
}
Just create a class somewhere which only has static variables.
class Constant {
static let a = "demo1"
static let b = "demo2"
}