Atomic

1.0.1

shareup/atomic

What's New

1.0.1

2019-07-07T12:37:07Z

Fix Xcode 11 beta 3 warnings

Atomic

Atomic is a lightweight property wrapper that guarantees thread-safe access to properties decorated with the @Atomic attribute.

Usage

class Task {
    @Atomic var title: String

    init(title: String) {
        $title = Atomic(title)
    }
}

let task = Task(title: "Buy groceries")

DispatchQueue.global().async { task.title = "Buy flowers" }
DispatchQueue.global().async { task.title = "Clean kitchen" }

Installation

Swift Package Manager

To use Atomic with the Swift Package Manager, add a dependency to your Package.swift file:

let package = Package(
    dependencies: [
        .package(url: "https://github.com/shareup/atomic.git", .upToNextMajor(from: "1.0.0"))
    ]
)

Linux is not currently supported

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Mar 16 2024 20:38:30 GMT-0900 (Hawaii-Aleutian Daylight Time)