Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

[DEPRECATED] A default CustomStringConvertible implementation for Swift types

License

Notifications You must be signed in to change notification settings

jessesquires/DefaultStringConvertible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3613b34 · Jan 2, 2018

History

57 Commits
Dec 13, 2016
Dec 7, 2016
Dec 7, 2016
Nov 20, 2016
Dec 7, 2016
Jun 5, 2016
Oct 1, 2016
Sep 19, 2016
Dec 7, 2016
Nov 20, 2016
Nov 20, 2016
Apr 26, 2016
Apr 26, 2016
Jan 2, 2018
Dec 26, 2016

Repository files navigation

No Maintenance Intended

⚠️ DEPRECATED ⚠️

DefaultStringConvertible

Build Status Version Status license MIT codecov Platform Carthage compatible

A default CustomStringConvertible implementation for Swift types

About

Never implement var description: String again. Simply import DefaultStringConvertible and conform to CustomStringConvertible and get a default type description for free.

This micro-library is based on this post from Erica Sadun.

Requirements

  • Swift 3
  • Xcode 8
  • iOS 8.0+
  • macOS 10.10+
  • tvOS 9.0+
  • watchOS 2.0+
  • Ubuntu 14.04+

Installation

CocoaPods (recommended)

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)
    ]
)

Documentation

Read the docs. Generated with jazzy. Hosted by GitHub Pages.

Generate

$ ./build_docs.sh

Preview

$ open index.html -a Safari

Getting Started

import DefaultStringConvertible

class MyClass: CustomStringConvertible {
    // ...

    // You *do not* need to implement `var description: String`
    // by importing `DefaultStringConvertible`, you get a default `description` for free
}

Unit tests

There's a suite of unit tests for DefaultStringConvertible. Run them from Xcode by opening DefaultStringConvertible.xcodeproj.

Contribute

Please follow these sweet contribution guidelines.

Credits

Created and maintained by @jesse_squires.

License

DefaultStringConvertible is released under an MIT License. See LICENSE for details.

Copyright © 2016-present Jesse Squires.

Please provide attribution, it is greatly appreciated.