bakkenbaeck / SweetSwift

Helpers and sugar for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Helpers and sugar for Swift

License:Other


Languages

Language:Swift 94.0%Language:Ruby 3.4%Language:Objective-C 2.6%