File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Sources/OpenAttributeGraphShims
Tests/OpenAttributeGraphCompatibilityTests Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 11//
2- // GraphShims .swift
2+ // AGShims .swift
33// OpenAttributeGraphShims
44
5- public enum AttributeGraphVendor : String {
6- case oag = " org.OpenSwiftUIProject.OpenAttributeGraph "
7- case ag = " com.apple.AttributeGraph "
8- case compute = " dev.incrematic.compute "
5+ /// A type that identifies the underlying attribute graph implementation vendor.
6+ ///
7+ /// Use `attributeGraphVendor` to check which vendor is active at runtime.
8+ public struct AttributeGraphVendor : RawRepresentable , Hashable , CaseIterable {
9+ public let rawValue : String
10+
11+ public init ( rawValue: String ) {
12+ self . rawValue = rawValue
13+ }
14+
15+ /// OpenAttributeGraph — the open-source implementation by OpenSwiftUIProject.
16+ public static let oag = AttributeGraphVendor ( rawValue: " org.OpenSwiftUIProject.OpenAttributeGraph " )
17+
18+ /// Apple's private AttributeGraph framework.
19+ public static let ag = AttributeGraphVendor ( rawValue: " com.apple.AttributeGraph " )
20+
21+ /// An incremental computation library for Swift by @jcmosc
22+ public static let compute = AttributeGraphVendor ( rawValue: " dev.incrematic.compute " )
23+
24+ public static var allCases : [ AttributeGraphVendor ] { [ . oag, . ag, . compute] }
925}
1026
1127#if OPENATTRIBUTEGRAPH_COMPUTE
Original file line number Diff line number Diff line change 11//
2- // GraphShims .swift
2+ // OAGShims .swift
33// OpenAttributeGraphCompatibilityTests
44
55#if OPENATTRIBUTEGRAPH
You can’t perform that action at this time.
0 commit comments