• This repository has been archived on 13/Jul/2019
  • Stars
    star
    119
  • Rank 297,871 (Top 6 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] A default CustomStringConvertible implementation for Swift types

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'

Carthage

github "jessesquires/DefaultStringConvertible"

Swift Package Manager

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.

More Repositories

1

JSQMessagesViewController

An elegant messages UI library for iOS
Objective-C
11,142
star
2

JSQDataSourcesKit

⚠️ Deprecated ⚠️
Swift
683
star
3

JSQCoreDataKit

A swifter Core Data stack
Swift
615
star
4

JSQSystemSoundPlayer

A fancy Obj-C wrapper for Cocoa System Sound Services
Objective-C
581
star
5

PresenterKit

⚠️ Deprecated ⚠️
Swift
551
star
6

Foil

A lightweight property wrapper for UserDefaults done right
Swift
457
star
7

JSQWebViewController

[Deprecated] A lightweight Swift WebKit view controller for iOS
Swift
305
star
8

TIL

Things I've learned and/or things I want to remember. Notes, links, advice, example code, etc.
282
star
9

JSQNotificationObserverKit

[DEPRECATED] Generic notifications and observers for Cocoa and CocoaTouch
Swift
167
star
10

Nine41

Automate overriding the status bars for all running iOS simulators
Swift
160
star
11

JSQFlatButton

[DEPRECATED] A light-weight, flat design UIButton for iOS
Objective-C
120
star
12

swift-sorts

A collection of sorting algorithms implemented in Swift
Swift
106
star
13

esoteric-swift

A collection of obscure Swift programs. The less comprehensible, the better — just like normal code.
Swift
96
star
14

app-icons-script

Photoshop script to generate all iOS and macOS app icons
JavaScript
84
star
15

ReactiveCollectionsKit

Data-driven, declarative, reactive, diffable collections (and lists!) for iOS. A modern, fast, and flexible library for UICollectionView done right.
Swift
81
star
16

swift-proposal-analyzer

An analysis of Swift Evolution proposals
Swift
58
star
17

objc-sorts

A collection of sorting algorithms implemented in Objective-C
Objective-C
52
star
18

gh-workflows

A collection of useful generic GitHub Actions workflows
50
star
19

safari-tabs-to-omnifocus

AppleScript to export current Safari tabs to OmniFocus inbox items
49
star
20

jessesquires.com

Turing complete with a stack of 0xdeadbeef
HTML
45
star
21

JSQActivityKit

[DEPRECATED] Swift UIActivities for iOS
Swift
43
star
22

delete-uber

"There is no place for ethics in this business sweetheart." — a list of news articles (with excerpts) on Uber.
33
star
23

.github

Default community health files for all of my open-source projects
29
star
24

GrandSugarDispatch

[DEPRECATED] Syntactic sugar for Grand Central Dispatch (GCD)
Swift
27
star
25

ios-watchdog

Main thread watchdog for iOS
Objective-C
26
star
26

talks

Slides and materials for talks that I've given
Rich Text Format
25
star
27

template-iOS-macOS

Template repository for my iOS and macOS projects
Ruby
24
star
28

xcode-settings-backup

Backup of my Xcode configuration and various settings
Shell
21
star
29

icloud-backup-script

Backup your iCloud Drive documents using rsync
Shell
20
star
30

wwdc-notes

Taking notes on WWDC videos, new APIs, and announcements
13
star
31

drumpf

Safari Extensions are dead 💀 RIP.
JavaScript
10
star
32

playdate-learning

Learning how to make games for Playdate https://play.date
8
star
33

template-jekyll-site

Template repository for Jekyll websites
HTML
8
star
34

c-sorts

A collection of sorting algorithms implemented in C
C
8
star
35

FreedomFarts

Join the Fart Party! In God, We Fart.
Objective-C
5
star
36

rdar-19368054

Example project showing Swift compiler bug, rdar://19368054
Swift
2
star
37

likeyoungrecords

Website for Like Young Records. RIP.
PHP
2
star
38

a-world-without-police

A world without police
2
star
39

15puzzle.js

A 15 puzzle written in javascript - just a fun coding exercise
JavaScript
1
star
40

jessesquires.github.io

Open source projects homepage
1
star
41

sandbox-gh-workflows

A sandbox repo for testing GitHub Actions workflows
Ruby
1
star