Swiftpack.co - bakkenbaeck/SweetSwift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bakkenbaeck.
bakkenbaeck/SweetSwift 3.1.0
Helpers and sugar for Swift
⭐️ 10
🕓 3 years ago
.package(url: "https://github.com/bakkenbaeck/SweetSwift.git", from: "3.1.0")

SweetSwift

Version Carthage compatible platforms License

Table of Contents

Date

Easily break down a date into components with our helper method:

let date = Date()
date.components([.hour, .day, .year])

Or create a new date with the day/month/year and optional hour/minute/second components:

let date = Date.from(day: 22, month: 1, year: 2018)

String

Easily prepend to a string.

path.prepend("/")
normalizedPath = path.prepending("/")

Int

Create arrays of a number of things:

5.map { "Hello" }
// returns [ "Hello", "Hello", "Hello", "Hello", "Hello" ]

or run a given operation a number of times:

5.times {
    print("Swift is awesome!")
}

Installation

SweetSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SweetSwift' , '~> 2'

SweetSwift is also available through Carthage. To install it, simply add the following line to your Cartfile:

github "BakkenBaeck/SweetSwift"

License

SweetSwift is available under the MIT license. See the LICENSE file for more info.

Author

Bakken & Bæck, @UseSweet

GitHub

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

Release Notes

Support for prepending a string to an existing string
4 years ago
  • See #33 for more details, thanks to @Elland for the contribution!

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