Bridgeable.swift 399 B

12345678910111213141516
  1. //
  2. // Bridgeable.swift
  3. // ark_ui_basic_bridge
  4. import ark_ui_basic
  5. /// A type that can be converted to and from its counterpart.
  6. public protocol Bridgeable<Counterpart> {
  7. associatedtype Counterpart where Counterpart: Bridgeable, Counterpart.Counterpart == Self
  8. init(_ counterpart: Counterpart)
  9. }
  10. extension Bridgeable {
  11. public var counterpart: Self.Counterpart { .init(self) }
  12. }