Swiftpack.co - 0x0001SUI/PlatformSpecificValue as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by 0x0001SUI.
0x0001SUI/PlatformSpecificValue v0.1.0
(syntactic sugar)
⭐️ 1
🕓 3 weeks ago
.package(url: "https://github.com/0x0001SUI/PlatformSpecificValue.git", from: "v0.1.0")

PlatformSpecificValue

This library might come in handy when you have a lot of compile-time platform checks in your code.

import SwiftUI
import PlatformSpecificValue

struct ContentView: View {        
    private let shapeRadius: Int = platformSpecific(.macOS(15), .iOS(20))
    
    var body: some View {
        RoundedRectangle(cornerRadius: shapeRadius)
    }
}

GitHub

link
Stars: 1
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.1.0
3 weeks ago

Added interface with variadic arguments.

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