Skip to content

Commit 4c0e8a0

Browse files
committed
Add forEachField global function
1 parent 45d4c7a commit 4c0e8a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/OpenGraph/Runtime/Metadata.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ public func OGTypeApplyFields2(
2323
body: (UnsafePointer<Int8>, Int, Any.Type) -> Bool
2424
) -> Bool
2525

26+
@inlinable
27+
@inline(__always)
28+
public func forEachField(
29+
_ type: Any.Type,
30+
do body: (UnsafePointer<Int8>, Int, Any.Type) -> Void
31+
) {
32+
OGTypeApplyFields(type, body: body)
33+
}
34+
2635
extension Metadata: Swift.Hashable, Swift.CustomStringConvertible {
2736
@inlinable
2837
@inline(__always)

0 commit comments

Comments
 (0)