Skip to content

Commit bc235b1

Browse files
committed
Added Identifiable conformance to all relevant types
1 parent 312fc9d commit bc235b1

File tree

13 files changed

+64
-12
lines changed

13 files changed

+64
-12
lines changed

Sources/TimecodeKit/FeetAndFrames/FeetAndFrames.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public struct FeetAndFrames: Equatable, Hashable {
5252
}
5353
}
5454

55+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
56+
extension FeetAndFrames: Identifiable {
57+
public var id: Self { self }
58+
}
59+
5560
extension FeetAndFrames: CustomStringConvertible {
5661
public var description: String {
5762
stringValue

Sources/TimecodeKit/Timecode/Components/Component.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ extension Timecode {
1616
}
1717
}
1818

19+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
20+
extension Timecode.Component: Identifiable {
21+
public var id: Self { self }
22+
}
23+
1924
extension Timecode.Component: Sendable { }

Sources/TimecodeKit/Timecode/Components/Components.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ extension Timecode.Components: Equatable { }
164164

165165
extension Timecode.Components: Hashable { }
166166

167+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
168+
extension Timecode.Components: Identifiable {
169+
public var id: Self { self }
170+
}
171+
167172
extension Timecode.Components: Sendable { }
168173

169174
extension Timecode.Components: Codable { }

Sources/TimecodeKit/Timecode/FrameCount/FrameCount Value.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ extension Timecode.FrameCount.Value: Equatable, Hashable {
2626
// synthesized implementation
2727
}
2828

29+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
30+
extension Timecode.FrameCount.Value: Identifiable {
31+
public var id: Self { self }
32+
}
33+
2934
extension Timecode.FrameCount.Value: Sendable { }
3035

3136
extension Timecode.FrameCount.Value: CustomStringConvertible {

Sources/TimecodeKit/Timecode/FrameCount/FrameCount.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ extension Timecode.FrameCount {
121121
}
122122
}
123123

124-
// MARK: - Equatable / Hashable / Comparable / Sendable
124+
// MARK: - Equatable / Hashable / Comparable / Identifiable / Sendable
125125

126126
extension Timecode.FrameCount: Equatable, Hashable {
127127
public static func == (lhs: Self, rhs: Self) -> Bool {
@@ -143,6 +143,11 @@ extension Timecode.FrameCount: Comparable {
143143
}
144144
}
145145

146+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
147+
extension Timecode.FrameCount: Identifiable {
148+
public var id: Self { self }
149+
}
150+
146151
extension Timecode.FrameCount: Sendable { }
147152

148153
extension Timecode.FrameCount: CustomStringConvertible {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Identifiable.swift
3+
// TimecodeKit • https://github.com/orchetect/TimecodeKit
4+
// © 2020-2023 Steffan Andrews • Licensed under MIT License
5+
//
6+
7+
import Foundation
8+
9+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
10+
extension Timecode: Identifiable {
11+
public var id: Self { self }
12+
}

Sources/TimecodeKit/Timecode/SubFramesBase/SubFramesBase.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ extension Timecode.SubFramesBase: CustomStringConvertible {
4545
}
4646
}
4747

48+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
4849
extension Timecode.SubFramesBase: Identifiable {
49-
public var id: RawValue {
50-
rawValue
51-
}
50+
public var id: Self { self }
5251
}
5352

5453
extension Timecode.SubFramesBase: Sendable { }

Sources/TimecodeKit/Timecode/UpperLimit/UpperLimit.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ extension Timecode {
5858
extension Timecode.UpperLimit: Sendable { }
5959

6060
extension Timecode.UpperLimit: Codable { }
61+
62+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
63+
extension Timecode.UpperLimit: Identifiable {
64+
public var id: Self { self }
65+
}

Sources/TimecodeKit/TimecodeFrameRate/TimecodeFrameRate.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ extension TimecodeFrameRate: Sendable { }
203203

204204
extension TimecodeFrameRate: Codable { }
205205

206-
@available(macOS 10.15, macCatalyst 13, iOS 11, *)
206+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
207207
extension TimecodeFrameRate: Identifiable {
208-
public var id: String {
209-
rawValue
210-
}
208+
public var id: Self { self }
211209
}

Sources/TimecodeKit/TimecodeInterval/TimecodeInterval.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ extension TimecodeInterval {
7373
}
7474
}
7575

76+
@available(macOS 10.15, macCatalyst 13, iOS 11, tvOS 11, watchOS 6, *)
77+
extension TimecodeInterval: Identifiable {
78+
public var id: Self { self }
79+
}
80+
7681
extension TimecodeInterval: Sendable { }
7782

7883
// MARK: - CustomStringConvertible

0 commit comments

Comments
 (0)