Swift 4 Version
If you want to create a name for NotificationCenter:
extension Notification.Name {
static let updateDataList1 = Notification.Name("updateDataList1")
}
Subscribe to notifications:
NotificationCenter.default.addObserver(self, selector: #selector(youFunction), name: .updateDataList1, object: nil)
Send notification:
NotificationCenter.default.post(name: .updateDataList1, object: nil)
If you just want a class with variables to use:
class Keys {
static let key1 = "YOU_KEY"
static let key2 = "YOU_KEY"
}
Or:
struct Keys {
static let key1 = "YOU_KEY"
static let key2 = "YOU_KEY"
}