Skip to content

Instantly share code, notes, and snippets.

@cprovatas
Last active October 20, 2018 22:28
Show Gist options
  • Save cprovatas/75e290996eaee447e2bc75fa2ccf54bb to your computer and use it in GitHub Desktop.
Save cprovatas/75e290996eaee447e2bc75fa2ccf54bb to your computer and use it in GitHub Desktop.

Revisions

  1. cprovatas revised this gist Oct 20, 2018. No changes.
  2. cprovatas revised this gist Oct 20, 2018. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion TypeReflectable.swift
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    protocol TypeReflectable {
    var `Self`: Self.Type { get }
    static var `Self`: Self.Type { get }
  3. cprovatas created this gist Oct 20, 2018.
    15 changes: 15 additions & 0 deletions TypeReflectable.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    protocol TypeReflectable {
    var `Self`: Self.Type { get }
    static var `Self`: Self.Type { get }
    }

    extension TypeReflectable {
    var `Self`: Self.Type {
    return type(of: self)
    }

    static var `Self`: Self.Type {
    return self
    }
    }