Swiftpack.co -  evdwarf/closswift as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
evdwarf/closswift
A simple Swift utility for conditionally joining classNames together
.package(url: "https://github.com/evdwarf/closswift.git", from: "0.0.1")

Closswift

A simple Swift utility for conditionally joining classNames together.

How to use

import Closswift

// Strings (variadic)
let bar: Optional<String> = "bar"
closs("foo", bar, "baz");
//=> "foo bar baz"

// Dictionaries
closs(["foo" : true, "bar" : false], ["baz" : isTrue()]))
//=> "foo baz"

// Dictionaries (variadic)
closs(["foo" : true], ["bar" : false], String?.none, ["--foobar" : true])
//=> "foo --foobar"

// Arrays
closs("foo", 0 , false, "bar")
//=> "foo bar"

// Arrays (variadic)
closs(["foo"], ["", 0, false, "bar"])
//=> "foo bar"

Details

closs(...input)

Returns: String

input

Type: ClosswiftCombinable (Conform to 'Array, String, Optional, Bool, Dictionary')

GitHub

link
Stars: 0
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.

Release Notes

2 weeks ago

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