Latest 1.1.0
Homepage https://github.com/SweetOrg/SweetFoundation
License MIT
Platforms ios 9.0, osx 10.11, watchos 2.0, tvos 9.0, requires ARC
Frameworks Foundation
Authors

Version
License
Platform

Usage

Math helpers

Simple helpers to convert degrees to radians and vice-versa.

Math.degreesToRadians()
Math.radiansToDegrees()

DispatchQueue helpers

Dispatch async after using seconds (Double), instead of dealing with DispatchTime.

DispatchQueue.asyncAfter(seconds: 1.5) { }

Serialisation

We include a simple JSON to String serialiser that guarantees the order of dictionary keys to be alphabetical. This is essential when signing or hashing payloads.

let hashableString = OrderedSerializer.string(from: jsonPayload)

Base64 with or without padding

Sometimes you need to deal with base64 strings without the padding.

// Generate base64 string without padding from a Data structure.
let noPadding = "This is a test string".data(using: .utf8)!.base64EncodedStringWithoutPadding()

// sometimes you want the padding back.
noPadding.paddedForBase64

Installation

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

pod 'SweetFoundation'

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

github "SweetOrg/SweetFoundation"

License

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

Author

Bakken & Bæck, @SweetOrg

Latest podspec

{
    "name": "SweetFoundation",
    "summary": "Helpers and sugar for the Foundation framework",
    "version": "1.1.0",
    "homepage": "https://github.com/SweetOrg/SweetFoundation",
    "license": "MIT",
    "authors": {
        "Bakken & Bu00e6ck": "[email protected]"
    },
    "source": {
        "git": "https://github.com/SweetOrg/SweetFoundation.git",
        "tag": "1.1.0"
    },
    "social_media_url": "https://twitter.com/SweetOrg",
    "platforms": {
        "ios": "9.0",
        "osx": "10.11",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "requires_arc": true,
    "source_files": "Sources/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This