Latest0.0.2
Homepagehttps://github.com/seancatkinson/SCAAtomic
LicenseMIT
Platformsios 8.0, osx 10.9, requires ARC
Authors

A lightweight atomic wrapper in swift and C for iOS, OSX & tvOS

Features

  • [x] Atomic – Wrapper class with option to inject your own lock
  • [x] PerformOnce Example using Atomic instead of dispatch_once

Usage

let atomicBool = Atomic(false)
atomicBool.value = true
let originalValue = atomicBool.performAndReplace { current in 
    return false 
}
// originalValue = true
// atomicBool.value = false

let mappedValue = atomicBool.map { (currentValue) -> Int in
    return currentValue == true ? 1 : 0
}
// mappedValue = 0

Requirements

  • iOS 7.0+ / Mac OS X 10.9+
  • Xcode 7

Installation

Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks.

To use SCAAtomic with a project targeting iOS 7 or to include it manually, you must include the swift files located inside the Source directory directly in your project

CocoaPods

To integrate SCAAtomic into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'SCAAtomic', :git => 'https://github.com/seancatkinson/SCAAtomic.git'

License

SCAAtomic is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "SCAAtomic",
    "version": "0.0.2",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "A lightweight atomic wrapper in swift and C.",
    "homepage": "https://github.com/seancatkinson/SCAAtomic",
    "social_media_url": "https://twitter.com/seancatkinson",
    "authors": {
        "Sean Atkinson": "[email protected]"
    },
    "source": {
        "git": "https://github.com/seancatkinson/SCAAtomic.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "source_files": "Source/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This