Swiftpack.co - intitni/Whatever as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by intitni.
intitni/Whatever 1.3.0
Whatever offers you a placeholder when you are not sure what to type in code.
⭐️ 1
🕓 2 years ago
.package(url: "https://github.com/intitni/Whatever.git", from: "1.3.0")

Whatever

Whatever is a pacakge that offers you a placeholder when you are not sure what to type in code.

screenshot

Using WHATEVER emits warnings, and will crash at run time.

Usage

You can use the provided WHATEVER instance directly. But if you don't want to import everytime, you can create your own instance and add an available check to deprecate it.

@available(*, deprecated, message: "Replace WHATEVER.")
let WHATEVER = Whatever.WHATEVER

@available(*, deprecated, message: "Replace WhateverType.")
typealias WhateverType = Whatever

Preceding anything with WHATEVER

let s: String = WHATEVER.any.thing.that.doesnt.exit.yet

Using IS(_:) to make an instance of any type

WHATEVER.IS(UIColor.self)
let s: String = WHATEVER.IS()

Calling functions when the functions are not implemented or even named yet

WHATEVER(param: 123)

Calling methods from something doesn't exist yet

WHATEVER.viewDidAppear(true)

Rushly wrote a method call before you implement the method

WHATEVER.METHOD.dependency.service.doSomthing(param: true)
    .RETURNS(Promise<Void>.self)
    .then { _ in }
    .catch { _ in }

Defining a function that returns something not exists yet

func accept(whatever: Whatever) -> Whatever {
    return WHATEVER
}

Subscript! But on what

WHATEVER[0]
WHATEVER["What"]
WHATEVER[/*anithing*/]

Install

.package(url: "https://github.com/intitni/Whatever.git", .branch("main"))

GitHub

link
Stars: 1
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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