Swiftgram/submodules/MergeLists/Sources/Identifiable.swift
2019-10-06 04:25:10 +04:00

15 lines
282 B
Swift

import Foundation
public protocol Identifiable {
associatedtype T: Hashable
var stableId: T { get }
}
public struct AnyIdentifiable {
var stableId: AnyHashable
public init<T>(_ value: T) where T : Identifiable {
self.stableId = value.stableId
}
}