Swift has an available attribute that you can use for this. It’s available arguments include
- introduced
- deprecated
- obsoleted
- message
- renamed.
Or for the example you gave:
@available(*, unavailable, message: "init is unavailable, use initWithFrame")
init() {
}
@available(*, deprecated, message: "use shareWithPars: instead")
class func shareWithParams(params: NSDictionary) {
}
For more information on these attributes, check out the Attributes section in The Swift Programming Language. (currently page 627)