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
🕓 1 year 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: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v0.1.0
1 year ago

Added interface with variadic arguments.

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