TL;DR: use @objc
Source: the 5th comment to the 2nd answer to this Stack Overflow question.
Sample code:
@objc public var firstInitial: String {
willAccessValue(forKey: "firstInitial")
let name = self.name
didAccessValue(forKey: "firstInitial")
guard let groupName = name,
let initial = groupName.first else {
return ""
}
return String(initial).uppercased()
}
(and yes I know there are many different ways I could compute the first initial of a string.)