Swift has an available attribute that you can use for this. It's available arguments include:

  • unavailable
@available(*, unavailable, message: "f is unavailable ")
func f() {
}
  • deprecated
@available(*, deprecated, message: "f is deprecated ")
func f() {
}
  • obsoleted
@available(*, obsoleted, message: "f is obsoleted ")
func f() {
}
  • introduced
@available(*, introduced, message: "f is introduced ")
func f() {
}
  • renamed
@available(*, renamed, message: "f is renamed to fa ")
func fa() {
}

Swift Book