Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Add remove field functions
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Sep 30, 2024
1 parent ba6a46f commit 682947a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Model/User Interface/Scene/SceneStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions Sources/Model/User Interface/View/ViewStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 682947a

Please sign in to comment.