Add remove field functions

This commit is contained in:
david-swift 2024-09-30 10:04:24 +02:00
parent ba6a46f793
commit 682947abb0
2 changed files with 14 additions and 0 deletions

View File

@ -67,6 +67,13 @@ public actor SceneStorage {
fields[key] = value
}
/// Remove a certain field.
/// - Parameters:
/// - key: The key.
public func removeField(key: String) {
fields.removeValue(forKey: key)
}
/// Get the element of a certain field.
/// - Parameter key: The key.
/// - Returns: The field.

View File

@ -94,6 +94,13 @@ public actor ViewStorage: Sendable {
fields[key] = value
}
/// Remove a certain field.
/// - Parameters:
/// - key: The key.
public func removeField(key: String) {
fields.removeValue(forKey: key)
}
/// Get the element of a certain field.
/// - Parameter key: The key.
/// - Returns: The field.