Skip to content

Instantly share code, notes, and snippets.

@YanSte
Last active August 18, 2022 08:02
Show Gist options
  • Save YanSte/d2e464dbfa1d67e8a12fb17e63545f04 to your computer and use it in GitHub Desktop.
Save YanSte/d2e464dbfa1d67e8a12fb17e63545f04 to your computer and use it in GitHub Desktop.
Describable, Descriptible de classe, struct etc..
import Foundation
// MARK: - Describable
public protocol Describable {
var typeName: String { get }
static var typeName: String { get }
}
// MARK: - Describable extensions
public extension Describable {
var typeName: String {
return .init(describing: type(of: self))
}
static var typeName: String {
return .init(describing: self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment