Swiftpack.co - ikesyo/swift-with-previous as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
ikesyo/swift-with-previous
A Swift property wrapper which stores the previous value
.package(url: "https://github.com/ikesyo/swift-with-previous.git", from: "1.0.0")

swift-with-previous

A Swift property wrapper which stores the previous value. The previous value can be get by the projected value $propertyName.

import XCTest
import WithPrevious

final class WithPreviousTests: XCTestCase {
    @WithPrevious var value = 0

    func testWithPreviousWrapper() {
        XCTAssertEqual(value, 0)
        XCTAssertNil($value)

        value = 10

        XCTAssertEqual(value, 10)
        XCTAssertEqual($value, 0)
    }
}

License

MIT license. See LICENSE for details.

GitHub

link
Stars: 2
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

1.0.0
2 weeks ago
  • Initial release

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics