Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new lines #115

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// A protocol that provides methods for reading, writing, and deleting files in a type-safe, sendable manner.
public protocol FileManaging: Sendable {

/// Reads a file from the given path and decodes its contents into the specified type.
/// - Parameters:
/// - path: The directory path where the file is located. Defaults to the current directory `"."`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Foundation
/// A protocol that provides a thread-safe interface for interacting with `NSUbiquitousKeyValueStore`,
/// which synchronizes key-value data across the user's iCloud-enabled devices.
public protocol UbiquitousKeyValueStoreManaging: Sendable {

/// Retrieves data stored in iCloud for the specified key.
/// - Parameter key: The key used to retrieve the associated data from the `NSUbiquitousKeyValueStore`.
/// - Returns: The `Data` object associated with the key, or `nil` if no data is found.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// A protocol that provides a thread-safe interface for interacting with `UserDefaults`,
/// allowing the storage, retrieval, and removal of user preferences and data.
public protocol UserDefaultsManaging: Sendable {

/// Retrieves an object from `UserDefaults` for the given key.
/// - Parameter key: The key used to retrieve the associated value from `UserDefaults`.
/// - Returns: The value stored in `UserDefaults` for the given key, or `nil` if no value is associated with the key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ extension Application {
public func data(forKey key: String) -> Data? {
NSUbiquitousKeyValueStore.default.data(forKey: key)
}

public func set(_ value: Data?, forKey key: String) {
NSUbiquitousKeyValueStore.default.set(value, forKey: key)
}

public func removeObject(forKey key: String) {
NSUbiquitousKeyValueStore.default.removeObject(forKey: key)
}
Expand Down
Loading