[DEPRECATED] A default CustomStringConvertible implementation for Swift types
No Data
A default
CustomStringConvertibleimplementation for Swift types
Never implement
var description: Stringagain. Simply
import DefaultStringConvertibleand conform to
CustomStringConvertibleand get a default type description for free.
This micro-library is based on this post from Erica Sadun.
use_frameworks!For latest release in cocoapods
pod 'DefaultStringConvertible'
Feeling adventurous? Get the latest on develop
pod 'DefaultStringConvertible', :git => 'https://github.com/jessesquires/DefaultStringConvertible.git', :branch => 'develop'
github "jessesquires/DefaultStringConvertible"
Add DefaultStringConvertible as a dependency to your
Package.swift. For example:
let package = Package( name: "YourPackageName", dependencies: [ .Package(url: "https://github.com/jessesquires/DefaultStringConvertible.git", majorVersion: 2) ] )
Read the docs. Generated with jazzy. Hosted by GitHub Pages.
$ ./build_docs.sh
$ open index.html -a Safari
import DefaultStringConvertibleclass MyClass: CustomStringConvertible { // ...
// You *do not* need to implement `var description: String` // by importing `DefaultStringConvertible`, you get a default `description` for free
}
There's a suite of unit tests for
DefaultStringConvertible. Run them from Xcode by opening
DefaultStringConvertible.xcodeproj.
Please follow these sweet contribution guidelines.
Created and maintained by @jesse_squires.
DefaultStringConvertibleis released under an MIT License. See
LICENSEfor details.
Copyright © 2016-present Jesse Squires.
Please provide attribution, it is greatly appreciated.