Swiftpack.co - LudvigSahlin/Trifles as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
LudvigSahlin/Trifles
Packed with small useful extension functions
.package(url: "https://github.com/LudvigSahlin/Trifles.git", from: "0.1.0")

Trifles

This package is packed with small useful extension functions. It also contains helper functions defined in Trifles.swift.

Extension functions

Array:

  • isNeitherNilNorEmpty

Date:

  • todayMidnight
  • tomorrowMidnight
  • yesterdayMidnight

Optional:

  • isNeitherNilNorEmpty

UIView:

  • applyBorders
  • applyShadow
  • applyCardTraits

UIViewController:

  • dismissKeyboardOnTap

Other helper functions

Trifles:

  • TextField.build // Adds subviews and sets basic styling. Sets no constraints.
  • Button.build // Adds subviews and sets basic styling. Sets no constraints.

Usage:

Most functions should be self explanatory. Here are two examples:

let (containerView, backgroundView, label) = Trifles.Button.build()
containerView.applyBorders()

And if the keyboard should be dismissed when tapping:

override func viewDidLoad() {
    super.viewDidLoad()
    dismissKeyboardOnTap()
}

License

The contents of this repository is licensed under the Apache License, version 2.0.

Contact

ludvigsahlin2@gmail.com

GitHub

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

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

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