The only library you hope to remove!

What's New




  • Use standard Swift Package structure to be more lightweight and more Xcode syntax coloring and autocomplete friendly.


  • Support for CocoaPods and Carthage has been discontinued, Swift Package Manager is now mature enough for production and it's the official and preferred package manager. CocoaPods and Carthage can still be used, if needed, by importing version 4.0.0, since no API has changed.

ShitLib (oh Shit!)

Swift Quality Gate Status codecov Join the chat at

The only library you hope to remove!

The library that helps you remember about things done bad. With ShitLib you will be always aware of the shitty code inside your application.


Are you writing unwanted code, antipatterns, magic numbers? Are you scared about what you are doing? Use ShitLib to refer your shitty code so you will remember it. How? Remove ShitLib dependency and your code will not compile anymore until you will remove all of the shitty code.

Oh your boss forced you to get the first element of a list and you know that it's wrong: you can use OhShit!

import ShitLib

class MyBeautifulClass {
    let elements: [String] = [**some elements inside**]

    func iDontWantToDoThisButWeMustReleaseASAP() {
        let element = elements[OhShit.os0] // <--- OhShit Constant
        doSomeThing(with: element)

    func doSomeThing(with element: String) {
        // anything

Maybe you are thinking where the convenience is in using this lib. It's simple, this is the most useful library when it is removed from dependencies. After doing that, your project will not compile anymore and you will be immediately aware of what to do. Fix it!

Other ways to use ShitLib? Let's give a try to the method API

import ShitLib

class MyBeautifulUnconfigurableClass {
    enum PasswordError: Error {
        case length(maxLength: Int)

    let maxPasswordSize: Int = OhShit.ohShit(7)! // I cannot parameterize now

    public func set(password: String) throws {
        if password.count > maxPasswordSize {
            throw PasswordError.length(maxLength: maxPasswordSize)


Swift Package Manager

ShitLib is compatible with Swift Package Manager. To use it, add the following as a dependency to your Package.swift file:

.package(url: "", .upToNextMajor(from: "5.0.0"))

Other package managers

Since version 5.0.0, support for CocoaPods and Carthage has been discontinued, if you need to use them for any reason, you can use version 4.0.0, since the API isn't changed.


ShitLib till version 4.0.0 is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ShitLib', '~> 4.0'


ShitLib till version 4.0.0 is compatible with Carthage. To use it, add the following line to your Cartfile:

github "ShitLib/shitlib-swift" ~> 4.0.0

What's new

Checkout our changelog.


This project is released under the MIT License.


  • Swift Tools 5.5.0
View More Packages from this Author


  • None
Last updated: Fri Mar 24 2023 00:29:54 GMT-0500 (GMT-05:00)