├── .codecov.yml ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── DefaultStringConvertible.podspec ├── DefaultStringConvertible.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── DefaultStringConvertible-OSX.xcscheme │ ├── DefaultStringConvertible-iOS.xcscheme │ ├── DefaultStringConvertible-tvOS.xcscheme │ └── DefaultStringConvertible-watchOS.xcscheme ├── LICENSE ├── Package.swift ├── README.md ├── Sources ├── DefaultStringConvertible.h ├── DefaultStringConvertible.swift └── Info.plist └── Tests ├── DefaultStringConvertibleTests.swift └── Info.plist /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | branch: develop 3 | 4 | coverage: 5 | precision: 2 6 | round: nearest 7 | range: "60...100" 8 | ignore: 9 | - Tests/* 10 | 11 | status: 12 | project: 13 | default: 14 | target: auto 15 | threshold: 2.0 16 | branches: 17 | - master 18 | - develop 19 | 20 | patch: 21 | default: 22 | target: auto 23 | branches: 24 | - master 25 | - develop 26 | 27 | comment: 28 | layout: "header, diff, changes, sunburst, uncovered" 29 | branches: 30 | - master 31 | - develop 32 | behavior: default 33 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## New issue checklist 2 | 3 | 4 | - [ ] I have read all of the [`README`](https://github.com/jessesquires/DefaultStringConvertible/blob/develop/README.md) and [documentation](http://www.jessesquires.com/DefaultStringConvertible/). 5 | - [ ] I have reviewed the [contributing guidelines](https://github.com/jessesquires/HowToContribute). 6 | - [ ] I have searched [existing issues](https://github.com/jessesquires/DefaultStringConvertible/issues?q=is%3Aissue+sort%3Acreated-desc) and **this is not a duplicate**. 7 | 8 | ## General information 9 | 10 | - Library version(s): 11 | - OS version(s): 12 | - Devices/Simulators affected: 13 | - Reproducible in the demo project (Yes/No): 14 | - Related issues: 15 | 16 | ## Expected behavior 17 | 18 | > ... 19 | 20 | ## Actual behavior 21 | 22 | > ... 23 | 24 | ## Steps to reproduce 25 | 26 | > ... 27 | 28 | ### Crash log? Screenshots? Videos? Sample project? 29 | 30 | > ... 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pull request checklist 2 | 3 | - [ ] All tests pass. Demo project builds and runs. 4 | - [ ] I have resolved any merge conflicts. 5 | - [ ] I have followed the [coding style](https://github.com/jessesquires/HowToContribute#style-guidelines), and reviewed the [contributing guidelines](https://github.com/jessesquires/HowToContribute). 6 | 7 | #### This fixes issue #___. 8 | 9 | ## What's in this pull request? 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Xcode 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | Pods/ 32 | 33 | # Carthage 34 | Carthage/Checkouts 35 | Carthage/Build 36 | 37 | # fastlane 38 | fastlane/report.xml 39 | fastlane/screenshots 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | 4 | env: 5 | global: 6 | - LANG=en_US.UTF-8 7 | 8 | - PROJECT="DefaultStringConvertible.xcodeproj" 9 | - IOS_SCHEME="DefaultStringConvertible-iOS" 10 | - OSX_SCHEME="DefaultStringConvertible-OSX" 11 | - TVOS_SCHEME="DefaultStringConvertible-tvOS" 12 | - WATCHOS_SCHEME="DefaultStringConvertible-watchOS" 13 | 14 | - IOS_SDK=iphonesimulator9.3 15 | - OSX_SDK=macosx10.11 16 | - TVOS_SDK=appletvsimulator9.2 17 | - WATCHOS_SDK=watchsimulator2.2 18 | 19 | matrix: 20 | - DESTINATION="OS=8.1,name=iPhone 4s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="YES" 21 | - DESTINATION="OS=8.2,name=iPhone 5" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 22 | - DESTINATION="OS=8.3,name=iPhone 5s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 23 | - DESTINATION="OS=8.4,name=iPhone 6" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 24 | - DESTINATION="OS=9.0,name=iPhone 6s" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 25 | - DESTINATION="OS=9.1,name=iPhone 6 Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 26 | - DESTINATION="OS=9.2,name=iPhone 6s Plus" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 27 | - DESTINATION="OS=9.3,name=iPad Air" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 28 | 29 | - DESTINATION="arch=x86_64" SDK="$OSX_SDK" SCHEME="$OSX_FRAMEWORK_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 30 | 31 | - DESTINATION="OS=9.0,name=Apple TV 1080p" SDK="$TVOS_SDK" SCHEME="$TVOS_SCHEME" RUN_TESTS="YES" POD_LINT="NO" 32 | 33 | - DESTINATION="OS=2.0,name=Apple Watch - 38mm" SDK="$WATCHOS_SDK" SCHEME="$WATCHOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 34 | - DESTINATION="OS=2.2,name=Apple Watch - 42mm" SDK="$WATCHOS_SDK" SCHEME="$WATCHOS_SCHEME" RUN_TESTS="NO" POD_LINT="NO" 35 | 36 | script: 37 | 38 | - if [ $POD_LINT == "YES" ]; then 39 | pod spec lint; 40 | pod lib lint; 41 | fi 42 | 43 | - if [ $RUN_TESTS == "YES" ]; then 44 | xcodebuild test -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO | xcpretty -c; 45 | else 46 | xcodebuild clean build -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO | xcpretty -c; 47 | fi 48 | 49 | # Build for reporting test coverage 50 | - if [ $RUN_TESTS == "YES" ]; then 51 | xcodebuild test -project DefaultStringConvertible.xcodeproj -scheme "DefaultStringConvertible-iOS" -sdk iphonesimulator; 52 | fi 53 | 54 | after_success: 55 | - bash <(curl -s https://codecov.io/bash) 56 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | The changelog for `DefaultStringConvertible`. Also see the [releases](https://github.com/jessesquires/DefaultStringConvertible/releases) on GitHub. 4 | 5 | -------------------------------------- 6 | 7 | 1.1.0 8 | ----- 9 | 10 | This release closes the [1.1.0 milestone](https://github.com/jessesquires/DefaultStringConvertible/issues?q=milestone%3A1.1.0). 11 | 12 | - Added even more detailed option, `public var deepDescription: String`. (#1, #2) Thanks @mhuusko5 ! 13 | 14 | 1.0.0 15 | ----- 16 | 17 | Initial release. :tada: 18 | -------------------------------------------------------------------------------- /DefaultStringConvertible.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DefaultStringConvertible' 3 | s.version = '1.1.0' 4 | s.license = 'MIT' 5 | 6 | s.summary = 'A default CustomStringConvertible implementation for Swift types' 7 | s.homepage = 'https://github.com/jessesquires/DefaultStringConvertible' 8 | s.documentation_url = 'http://www.jessesquires.com/DefaultStringConvertible/' 9 | s.social_media_url = 'https://twitter.com/jesse_squires' 10 | s.author = 'Jesse Squires' 11 | 12 | s.source = { :git => 'https://github.com/jessesquires/DefaultStringConvertible.git', :tag => s.version } 13 | s.source_files = 'Sources/*.swift' 14 | 15 | s.ios.deployment_target = '8.0' 16 | s.osx.deployment_target = '10.10' 17 | s.tvos.deployment_target = '9.0' 18 | s.watchos.deployment_target = '2.0' 19 | 20 | s.requires_arc = true 21 | end 22 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8870AA4F1CCEF912006CE7D0 /* DefaultStringConvertible.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8870AA441CCEF912006CE7D0 /* DefaultStringConvertible.framework */; }; 11 | 8870AA641CCEF949006CE7D0 /* DefaultStringConvertible.h in Headers */ = {isa = PBXBuildFile; fileRef = 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 8870AA691CCEF9B3006CE7D0 /* DefaultStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */; }; 13 | 8870AA6A1CCEFA62006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA621CCEF949006CE7D0 /* DefaultStringConvertibleTests.swift */; }; 14 | 8870AA7A1CCEFD66006CE7D0 /* DefaultStringConvertible.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8870AA701CCEFD66006CE7D0 /* DefaultStringConvertible.framework */; }; 15 | 8870AA871CCEFDA2006CE7D0 /* DefaultStringConvertible.h in Headers */ = {isa = PBXBuildFile; fileRef = 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | 8870AA881CCEFDA8006CE7D0 /* DefaultStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */; }; 17 | 8870AA891CCEFDAC006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA621CCEF949006CE7D0 /* DefaultStringConvertibleTests.swift */; }; 18 | 8870AA991CCEFE38006CE7D0 /* DefaultStringConvertible.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8870AA8F1CCEFE38006CE7D0 /* DefaultStringConvertible.framework */; }; 19 | 8870AAA61CCEFE89006CE7D0 /* DefaultStringConvertible.h in Headers */ = {isa = PBXBuildFile; fileRef = 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20 | 8870AAA71CCEFE91006CE7D0 /* DefaultStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */; }; 21 | 8870AAA81CCEFE96006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA621CCEF949006CE7D0 /* DefaultStringConvertibleTests.swift */; }; 22 | 8870AAC31CCEFF93006CE7D0 /* DefaultStringConvertible.h in Headers */ = {isa = PBXBuildFile; fileRef = 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | 8870AAC41CCEFF9A006CE7D0 /* DefaultStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 8870AA501CCEF912006CE7D0 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 8870AA3B1CCEF912006CE7D0 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 8870AA431CCEF912006CE7D0; 32 | remoteInfo = DefaultStringConvertible; 33 | }; 34 | 8870AA7B1CCEFD66006CE7D0 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 8870AA3B1CCEF912006CE7D0 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 8870AA6F1CCEFD66006CE7D0; 39 | remoteInfo = "DefaultStringConvertible-OSX"; 40 | }; 41 | 8870AA9A1CCEFE38006CE7D0 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 8870AA3B1CCEF912006CE7D0 /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = 8870AA8E1CCEFE38006CE7D0; 46 | remoteInfo = "DefaultStringConvertible-tvOS"; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXFileReference section */ 51 | 8870AA441CCEF912006CE7D0 /* DefaultStringConvertible.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DefaultStringConvertible.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 8870AA4E1CCEF912006CE7D0 /* DefaultStringConvertible-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DefaultStringConvertible-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultStringConvertible.h; sourceTree = ""; }; 54 | 8870AA601CCEF949006CE7D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 8870AA621CCEF949006CE7D0 /* DefaultStringConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultStringConvertibleTests.swift; sourceTree = ""; }; 56 | 8870AA631CCEF949006CE7D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultStringConvertible.swift; sourceTree = ""; }; 58 | 8870AA701CCEFD66006CE7D0 /* DefaultStringConvertible.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DefaultStringConvertible.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 8870AA791CCEFD66006CE7D0 /* DefaultStringConvertible-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DefaultStringConvertible-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 8870AA8F1CCEFE38006CE7D0 /* DefaultStringConvertible.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DefaultStringConvertible.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 8870AA981CCEFE38006CE7D0 /* DefaultStringConvertible-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DefaultStringConvertible-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | 8870AABB1CCEFF41006CE7D0 /* DefaultStringConvertible.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DefaultStringConvertible.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 8870AA401CCEF912006CE7D0 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 8870AA4B1CCEF912006CE7D0 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 8870AA4F1CCEF912006CE7D0 /* DefaultStringConvertible.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 8870AA6C1CCEFD66006CE7D0 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | 8870AA761CCEFD66006CE7D0 /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | 8870AA7A1CCEFD66006CE7D0 /* DefaultStringConvertible.framework in Frameworks */, 93 | ); 94 | runOnlyForDeploymentPostprocessing = 0; 95 | }; 96 | 8870AA8B1CCEFE38006CE7D0 /* Frameworks */ = { 97 | isa = PBXFrameworksBuildPhase; 98 | buildActionMask = 2147483647; 99 | files = ( 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | 8870AA951CCEFE38006CE7D0 /* Frameworks */ = { 104 | isa = PBXFrameworksBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | 8870AA991CCEFE38006CE7D0 /* DefaultStringConvertible.framework in Frameworks */, 108 | ); 109 | runOnlyForDeploymentPostprocessing = 0; 110 | }; 111 | 8870AAB71CCEFF41006CE7D0 /* Frameworks */ = { 112 | isa = PBXFrameworksBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | ); 116 | runOnlyForDeploymentPostprocessing = 0; 117 | }; 118 | /* End PBXFrameworksBuildPhase section */ 119 | 120 | /* Begin PBXGroup section */ 121 | 8870AA3A1CCEF912006CE7D0 = { 122 | isa = PBXGroup; 123 | children = ( 124 | 8870AA5E1CCEF949006CE7D0 /* Sources */, 125 | 8870AA611CCEF949006CE7D0 /* Tests */, 126 | 8870AA451CCEF912006CE7D0 /* Products */, 127 | ); 128 | sourceTree = ""; 129 | }; 130 | 8870AA451CCEF912006CE7D0 /* Products */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 8870AA441CCEF912006CE7D0 /* DefaultStringConvertible.framework */, 134 | 8870AA4E1CCEF912006CE7D0 /* DefaultStringConvertible-iOSTests.xctest */, 135 | 8870AA701CCEFD66006CE7D0 /* DefaultStringConvertible.framework */, 136 | 8870AA791CCEFD66006CE7D0 /* DefaultStringConvertible-OSXTests.xctest */, 137 | 8870AA8F1CCEFE38006CE7D0 /* DefaultStringConvertible.framework */, 138 | 8870AA981CCEFE38006CE7D0 /* DefaultStringConvertible-tvOSTests.xctest */, 139 | 8870AABB1CCEFF41006CE7D0 /* DefaultStringConvertible.framework */, 140 | ); 141 | name = Products; 142 | sourceTree = ""; 143 | }; 144 | 8870AA5E1CCEF949006CE7D0 /* Sources */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 8870AA5F1CCEF949006CE7D0 /* DefaultStringConvertible.h */, 148 | 8870AA681CCEF9B3006CE7D0 /* DefaultStringConvertible.swift */, 149 | 8870AA601CCEF949006CE7D0 /* Info.plist */, 150 | ); 151 | path = Sources; 152 | sourceTree = ""; 153 | }; 154 | 8870AA611CCEF949006CE7D0 /* Tests */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 8870AA621CCEF949006CE7D0 /* DefaultStringConvertibleTests.swift */, 158 | 8870AA631CCEF949006CE7D0 /* Info.plist */, 159 | ); 160 | path = Tests; 161 | sourceTree = ""; 162 | }; 163 | /* End PBXGroup section */ 164 | 165 | /* Begin PBXHeadersBuildPhase section */ 166 | 8870AA411CCEF912006CE7D0 /* Headers */ = { 167 | isa = PBXHeadersBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 8870AA641CCEF949006CE7D0 /* DefaultStringConvertible.h in Headers */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | 8870AA6D1CCEFD66006CE7D0 /* Headers */ = { 175 | isa = PBXHeadersBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 8870AA871CCEFDA2006CE7D0 /* DefaultStringConvertible.h in Headers */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | 8870AA8C1CCEFE38006CE7D0 /* Headers */ = { 183 | isa = PBXHeadersBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 8870AAA61CCEFE89006CE7D0 /* DefaultStringConvertible.h in Headers */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | 8870AAB81CCEFF41006CE7D0 /* Headers */ = { 191 | isa = PBXHeadersBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | 8870AAC31CCEFF93006CE7D0 /* DefaultStringConvertible.h in Headers */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXHeadersBuildPhase section */ 199 | 200 | /* Begin PBXNativeTarget section */ 201 | 8870AA431CCEF912006CE7D0 /* DefaultStringConvertible-iOS */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 8870AA581CCEF912006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-iOS" */; 204 | buildPhases = ( 205 | 8870AA3F1CCEF912006CE7D0 /* Sources */, 206 | 8870AA401CCEF912006CE7D0 /* Frameworks */, 207 | 8870AA411CCEF912006CE7D0 /* Headers */, 208 | 8870AA421CCEF912006CE7D0 /* Resources */, 209 | ); 210 | buildRules = ( 211 | ); 212 | dependencies = ( 213 | ); 214 | name = "DefaultStringConvertible-iOS"; 215 | productName = DefaultStringConvertible; 216 | productReference = 8870AA441CCEF912006CE7D0 /* DefaultStringConvertible.framework */; 217 | productType = "com.apple.product-type.framework"; 218 | }; 219 | 8870AA4D1CCEF912006CE7D0 /* DefaultStringConvertible-iOSTests */ = { 220 | isa = PBXNativeTarget; 221 | buildConfigurationList = 8870AA5B1CCEF912006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-iOSTests" */; 222 | buildPhases = ( 223 | 8870AA4A1CCEF912006CE7D0 /* Sources */, 224 | 8870AA4B1CCEF912006CE7D0 /* Frameworks */, 225 | 8870AA4C1CCEF912006CE7D0 /* Resources */, 226 | ); 227 | buildRules = ( 228 | ); 229 | dependencies = ( 230 | 8870AA511CCEF912006CE7D0 /* PBXTargetDependency */, 231 | ); 232 | name = "DefaultStringConvertible-iOSTests"; 233 | productName = DefaultStringConvertibleTests; 234 | productReference = 8870AA4E1CCEF912006CE7D0 /* DefaultStringConvertible-iOSTests.xctest */; 235 | productType = "com.apple.product-type.bundle.unit-test"; 236 | }; 237 | 8870AA6F1CCEFD66006CE7D0 /* DefaultStringConvertible-OSX */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = 8870AA811CCEFD66006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-OSX" */; 240 | buildPhases = ( 241 | 8870AA6B1CCEFD66006CE7D0 /* Sources */, 242 | 8870AA6C1CCEFD66006CE7D0 /* Frameworks */, 243 | 8870AA6D1CCEFD66006CE7D0 /* Headers */, 244 | 8870AA6E1CCEFD66006CE7D0 /* Resources */, 245 | ); 246 | buildRules = ( 247 | ); 248 | dependencies = ( 249 | ); 250 | name = "DefaultStringConvertible-OSX"; 251 | productName = "DefaultStringConvertible-OSX"; 252 | productReference = 8870AA701CCEFD66006CE7D0 /* DefaultStringConvertible.framework */; 253 | productType = "com.apple.product-type.framework"; 254 | }; 255 | 8870AA781CCEFD66006CE7D0 /* DefaultStringConvertible-OSXTests */ = { 256 | isa = PBXNativeTarget; 257 | buildConfigurationList = 8870AA841CCEFD66006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-OSXTests" */; 258 | buildPhases = ( 259 | 8870AA751CCEFD66006CE7D0 /* Sources */, 260 | 8870AA761CCEFD66006CE7D0 /* Frameworks */, 261 | 8870AA771CCEFD66006CE7D0 /* Resources */, 262 | ); 263 | buildRules = ( 264 | ); 265 | dependencies = ( 266 | 8870AA7C1CCEFD66006CE7D0 /* PBXTargetDependency */, 267 | ); 268 | name = "DefaultStringConvertible-OSXTests"; 269 | productName = "DefaultStringConvertible-OSXTests"; 270 | productReference = 8870AA791CCEFD66006CE7D0 /* DefaultStringConvertible-OSXTests.xctest */; 271 | productType = "com.apple.product-type.bundle.unit-test"; 272 | }; 273 | 8870AA8E1CCEFE38006CE7D0 /* DefaultStringConvertible-tvOS */ = { 274 | isa = PBXNativeTarget; 275 | buildConfigurationList = 8870AAA01CCEFE38006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-tvOS" */; 276 | buildPhases = ( 277 | 8870AA8A1CCEFE38006CE7D0 /* Sources */, 278 | 8870AA8B1CCEFE38006CE7D0 /* Frameworks */, 279 | 8870AA8C1CCEFE38006CE7D0 /* Headers */, 280 | 8870AA8D1CCEFE38006CE7D0 /* Resources */, 281 | ); 282 | buildRules = ( 283 | ); 284 | dependencies = ( 285 | ); 286 | name = "DefaultStringConvertible-tvOS"; 287 | productName = "DefaultStringConvertible-tvOS"; 288 | productReference = 8870AA8F1CCEFE38006CE7D0 /* DefaultStringConvertible.framework */; 289 | productType = "com.apple.product-type.framework"; 290 | }; 291 | 8870AA971CCEFE38006CE7D0 /* DefaultStringConvertible-tvOSTests */ = { 292 | isa = PBXNativeTarget; 293 | buildConfigurationList = 8870AAA31CCEFE38006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-tvOSTests" */; 294 | buildPhases = ( 295 | 8870AA941CCEFE38006CE7D0 /* Sources */, 296 | 8870AA951CCEFE38006CE7D0 /* Frameworks */, 297 | 8870AA961CCEFE38006CE7D0 /* Resources */, 298 | ); 299 | buildRules = ( 300 | ); 301 | dependencies = ( 302 | 8870AA9B1CCEFE38006CE7D0 /* PBXTargetDependency */, 303 | ); 304 | name = "DefaultStringConvertible-tvOSTests"; 305 | productName = "DefaultStringConvertible-tvOSTests"; 306 | productReference = 8870AA981CCEFE38006CE7D0 /* DefaultStringConvertible-tvOSTests.xctest */; 307 | productType = "com.apple.product-type.bundle.unit-test"; 308 | }; 309 | 8870AABA1CCEFF41006CE7D0 /* DefaultStringConvertible-watchOS */ = { 310 | isa = PBXNativeTarget; 311 | buildConfigurationList = 8870AAC21CCEFF41006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-watchOS" */; 312 | buildPhases = ( 313 | 8870AAB61CCEFF41006CE7D0 /* Sources */, 314 | 8870AAB71CCEFF41006CE7D0 /* Frameworks */, 315 | 8870AAB81CCEFF41006CE7D0 /* Headers */, 316 | 8870AAB91CCEFF41006CE7D0 /* Resources */, 317 | ); 318 | buildRules = ( 319 | ); 320 | dependencies = ( 321 | ); 322 | name = "DefaultStringConvertible-watchOS"; 323 | productName = "DefaultStringConvertible-watchOS"; 324 | productReference = 8870AABB1CCEFF41006CE7D0 /* DefaultStringConvertible.framework */; 325 | productType = "com.apple.product-type.framework"; 326 | }; 327 | /* End PBXNativeTarget section */ 328 | 329 | /* Begin PBXProject section */ 330 | 8870AA3B1CCEF912006CE7D0 /* Project object */ = { 331 | isa = PBXProject; 332 | attributes = { 333 | LastSwiftUpdateCheck = 0730; 334 | LastUpgradeCheck = 0730; 335 | ORGANIZATIONNAME = "Hexed Bits"; 336 | TargetAttributes = { 337 | 8870AA431CCEF912006CE7D0 = { 338 | CreatedOnToolsVersion = 7.3; 339 | }; 340 | 8870AA4D1CCEF912006CE7D0 = { 341 | CreatedOnToolsVersion = 7.3; 342 | }; 343 | 8870AA6F1CCEFD66006CE7D0 = { 344 | CreatedOnToolsVersion = 7.3; 345 | }; 346 | 8870AA781CCEFD66006CE7D0 = { 347 | CreatedOnToolsVersion = 7.3; 348 | }; 349 | 8870AA8E1CCEFE38006CE7D0 = { 350 | CreatedOnToolsVersion = 7.3; 351 | }; 352 | 8870AA971CCEFE38006CE7D0 = { 353 | CreatedOnToolsVersion = 7.3; 354 | }; 355 | 8870AABA1CCEFF41006CE7D0 = { 356 | CreatedOnToolsVersion = 7.3; 357 | }; 358 | }; 359 | }; 360 | buildConfigurationList = 8870AA3E1CCEF912006CE7D0 /* Build configuration list for PBXProject "DefaultStringConvertible" */; 361 | compatibilityVersion = "Xcode 3.2"; 362 | developmentRegion = English; 363 | hasScannedForEncodings = 0; 364 | knownRegions = ( 365 | en, 366 | ); 367 | mainGroup = 8870AA3A1CCEF912006CE7D0; 368 | productRefGroup = 8870AA451CCEF912006CE7D0 /* Products */; 369 | projectDirPath = ""; 370 | projectRoot = ""; 371 | targets = ( 372 | 8870AA431CCEF912006CE7D0 /* DefaultStringConvertible-iOS */, 373 | 8870AA4D1CCEF912006CE7D0 /* DefaultStringConvertible-iOSTests */, 374 | 8870AA6F1CCEFD66006CE7D0 /* DefaultStringConvertible-OSX */, 375 | 8870AA781CCEFD66006CE7D0 /* DefaultStringConvertible-OSXTests */, 376 | 8870AA8E1CCEFE38006CE7D0 /* DefaultStringConvertible-tvOS */, 377 | 8870AA971CCEFE38006CE7D0 /* DefaultStringConvertible-tvOSTests */, 378 | 8870AABA1CCEFF41006CE7D0 /* DefaultStringConvertible-watchOS */, 379 | ); 380 | }; 381 | /* End PBXProject section */ 382 | 383 | /* Begin PBXResourcesBuildPhase section */ 384 | 8870AA421CCEF912006CE7D0 /* Resources */ = { 385 | isa = PBXResourcesBuildPhase; 386 | buildActionMask = 2147483647; 387 | files = ( 388 | ); 389 | runOnlyForDeploymentPostprocessing = 0; 390 | }; 391 | 8870AA4C1CCEF912006CE7D0 /* Resources */ = { 392 | isa = PBXResourcesBuildPhase; 393 | buildActionMask = 2147483647; 394 | files = ( 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | }; 398 | 8870AA6E1CCEFD66006CE7D0 /* Resources */ = { 399 | isa = PBXResourcesBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | ); 403 | runOnlyForDeploymentPostprocessing = 0; 404 | }; 405 | 8870AA771CCEFD66006CE7D0 /* Resources */ = { 406 | isa = PBXResourcesBuildPhase; 407 | buildActionMask = 2147483647; 408 | files = ( 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | 8870AA8D1CCEFE38006CE7D0 /* Resources */ = { 413 | isa = PBXResourcesBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | ); 417 | runOnlyForDeploymentPostprocessing = 0; 418 | }; 419 | 8870AA961CCEFE38006CE7D0 /* Resources */ = { 420 | isa = PBXResourcesBuildPhase; 421 | buildActionMask = 2147483647; 422 | files = ( 423 | ); 424 | runOnlyForDeploymentPostprocessing = 0; 425 | }; 426 | 8870AAB91CCEFF41006CE7D0 /* Resources */ = { 427 | isa = PBXResourcesBuildPhase; 428 | buildActionMask = 2147483647; 429 | files = ( 430 | ); 431 | runOnlyForDeploymentPostprocessing = 0; 432 | }; 433 | /* End PBXResourcesBuildPhase section */ 434 | 435 | /* Begin PBXSourcesBuildPhase section */ 436 | 8870AA3F1CCEF912006CE7D0 /* Sources */ = { 437 | isa = PBXSourcesBuildPhase; 438 | buildActionMask = 2147483647; 439 | files = ( 440 | 8870AA691CCEF9B3006CE7D0 /* DefaultStringConvertible.swift in Sources */, 441 | ); 442 | runOnlyForDeploymentPostprocessing = 0; 443 | }; 444 | 8870AA4A1CCEF912006CE7D0 /* Sources */ = { 445 | isa = PBXSourcesBuildPhase; 446 | buildActionMask = 2147483647; 447 | files = ( 448 | 8870AA6A1CCEFA62006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */, 449 | ); 450 | runOnlyForDeploymentPostprocessing = 0; 451 | }; 452 | 8870AA6B1CCEFD66006CE7D0 /* Sources */ = { 453 | isa = PBXSourcesBuildPhase; 454 | buildActionMask = 2147483647; 455 | files = ( 456 | 8870AA881CCEFDA8006CE7D0 /* DefaultStringConvertible.swift in Sources */, 457 | ); 458 | runOnlyForDeploymentPostprocessing = 0; 459 | }; 460 | 8870AA751CCEFD66006CE7D0 /* Sources */ = { 461 | isa = PBXSourcesBuildPhase; 462 | buildActionMask = 2147483647; 463 | files = ( 464 | 8870AA891CCEFDAC006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */, 465 | ); 466 | runOnlyForDeploymentPostprocessing = 0; 467 | }; 468 | 8870AA8A1CCEFE38006CE7D0 /* Sources */ = { 469 | isa = PBXSourcesBuildPhase; 470 | buildActionMask = 2147483647; 471 | files = ( 472 | 8870AAA71CCEFE91006CE7D0 /* DefaultStringConvertible.swift in Sources */, 473 | ); 474 | runOnlyForDeploymentPostprocessing = 0; 475 | }; 476 | 8870AA941CCEFE38006CE7D0 /* Sources */ = { 477 | isa = PBXSourcesBuildPhase; 478 | buildActionMask = 2147483647; 479 | files = ( 480 | 8870AAA81CCEFE96006CE7D0 /* DefaultStringConvertibleTests.swift in Sources */, 481 | ); 482 | runOnlyForDeploymentPostprocessing = 0; 483 | }; 484 | 8870AAB61CCEFF41006CE7D0 /* Sources */ = { 485 | isa = PBXSourcesBuildPhase; 486 | buildActionMask = 2147483647; 487 | files = ( 488 | 8870AAC41CCEFF9A006CE7D0 /* DefaultStringConvertible.swift in Sources */, 489 | ); 490 | runOnlyForDeploymentPostprocessing = 0; 491 | }; 492 | /* End PBXSourcesBuildPhase section */ 493 | 494 | /* Begin PBXTargetDependency section */ 495 | 8870AA511CCEF912006CE7D0 /* PBXTargetDependency */ = { 496 | isa = PBXTargetDependency; 497 | target = 8870AA431CCEF912006CE7D0 /* DefaultStringConvertible-iOS */; 498 | targetProxy = 8870AA501CCEF912006CE7D0 /* PBXContainerItemProxy */; 499 | }; 500 | 8870AA7C1CCEFD66006CE7D0 /* PBXTargetDependency */ = { 501 | isa = PBXTargetDependency; 502 | target = 8870AA6F1CCEFD66006CE7D0 /* DefaultStringConvertible-OSX */; 503 | targetProxy = 8870AA7B1CCEFD66006CE7D0 /* PBXContainerItemProxy */; 504 | }; 505 | 8870AA9B1CCEFE38006CE7D0 /* PBXTargetDependency */ = { 506 | isa = PBXTargetDependency; 507 | target = 8870AA8E1CCEFE38006CE7D0 /* DefaultStringConvertible-tvOS */; 508 | targetProxy = 8870AA9A1CCEFE38006CE7D0 /* PBXContainerItemProxy */; 509 | }; 510 | /* End PBXTargetDependency section */ 511 | 512 | /* Begin XCBuildConfiguration section */ 513 | 8870AA561CCEF912006CE7D0 /* Debug */ = { 514 | isa = XCBuildConfiguration; 515 | buildSettings = { 516 | ALWAYS_SEARCH_USER_PATHS = NO; 517 | CLANG_ANALYZER_NONNULL = YES; 518 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 519 | CLANG_CXX_LIBRARY = "libc++"; 520 | CLANG_ENABLE_MODULES = YES; 521 | CLANG_ENABLE_OBJC_ARC = YES; 522 | CLANG_WARN_BOOL_CONVERSION = YES; 523 | CLANG_WARN_CONSTANT_CONVERSION = YES; 524 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 525 | CLANG_WARN_EMPTY_BODY = YES; 526 | CLANG_WARN_ENUM_CONVERSION = YES; 527 | CLANG_WARN_INT_CONVERSION = YES; 528 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 529 | CLANG_WARN_UNREACHABLE_CODE = YES; 530 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 531 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 532 | COPY_PHASE_STRIP = NO; 533 | CURRENT_PROJECT_VERSION = 1; 534 | DEBUG_INFORMATION_FORMAT = dwarf; 535 | ENABLE_STRICT_OBJC_MSGSEND = YES; 536 | ENABLE_TESTABILITY = YES; 537 | GCC_C_LANGUAGE_STANDARD = gnu99; 538 | GCC_DYNAMIC_NO_PIC = NO; 539 | GCC_NO_COMMON_BLOCKS = YES; 540 | GCC_OPTIMIZATION_LEVEL = 0; 541 | GCC_PREPROCESSOR_DEFINITIONS = ( 542 | "DEBUG=1", 543 | "$(inherited)", 544 | ); 545 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 546 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 547 | GCC_WARN_UNDECLARED_SELECTOR = YES; 548 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 549 | GCC_WARN_UNUSED_FUNCTION = YES; 550 | GCC_WARN_UNUSED_VARIABLE = YES; 551 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 552 | MTL_ENABLE_DEBUG_INFO = YES; 553 | ONLY_ACTIVE_ARCH = YES; 554 | SDKROOT = iphoneos; 555 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 556 | TARGETED_DEVICE_FAMILY = "1,2"; 557 | VERSIONING_SYSTEM = "apple-generic"; 558 | VERSION_INFO_PREFIX = ""; 559 | }; 560 | name = Debug; 561 | }; 562 | 8870AA571CCEF912006CE7D0 /* Release */ = { 563 | isa = XCBuildConfiguration; 564 | buildSettings = { 565 | ALWAYS_SEARCH_USER_PATHS = NO; 566 | CLANG_ANALYZER_NONNULL = YES; 567 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 568 | CLANG_CXX_LIBRARY = "libc++"; 569 | CLANG_ENABLE_MODULES = YES; 570 | CLANG_ENABLE_OBJC_ARC = YES; 571 | CLANG_WARN_BOOL_CONVERSION = YES; 572 | CLANG_WARN_CONSTANT_CONVERSION = YES; 573 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 574 | CLANG_WARN_EMPTY_BODY = YES; 575 | CLANG_WARN_ENUM_CONVERSION = YES; 576 | CLANG_WARN_INT_CONVERSION = YES; 577 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 578 | CLANG_WARN_UNREACHABLE_CODE = YES; 579 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 580 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 581 | COPY_PHASE_STRIP = NO; 582 | CURRENT_PROJECT_VERSION = 1; 583 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 584 | ENABLE_NS_ASSERTIONS = NO; 585 | ENABLE_STRICT_OBJC_MSGSEND = YES; 586 | GCC_C_LANGUAGE_STANDARD = gnu99; 587 | GCC_NO_COMMON_BLOCKS = YES; 588 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 589 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 590 | GCC_WARN_UNDECLARED_SELECTOR = YES; 591 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 592 | GCC_WARN_UNUSED_FUNCTION = YES; 593 | GCC_WARN_UNUSED_VARIABLE = YES; 594 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 595 | MTL_ENABLE_DEBUG_INFO = NO; 596 | SDKROOT = iphoneos; 597 | TARGETED_DEVICE_FAMILY = "1,2"; 598 | VALIDATE_PRODUCT = YES; 599 | VERSIONING_SYSTEM = "apple-generic"; 600 | VERSION_INFO_PREFIX = ""; 601 | }; 602 | name = Release; 603 | }; 604 | 8870AA591CCEF912006CE7D0 /* Debug */ = { 605 | isa = XCBuildConfiguration; 606 | buildSettings = { 607 | DEFINES_MODULE = YES; 608 | DYLIB_COMPATIBILITY_VERSION = 1; 609 | DYLIB_CURRENT_VERSION = 1; 610 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 611 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 612 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 613 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 614 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 615 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 616 | PRODUCT_NAME = DefaultStringConvertible; 617 | SKIP_INSTALL = YES; 618 | }; 619 | name = Debug; 620 | }; 621 | 8870AA5A1CCEF912006CE7D0 /* Release */ = { 622 | isa = XCBuildConfiguration; 623 | buildSettings = { 624 | DEFINES_MODULE = YES; 625 | DYLIB_COMPATIBILITY_VERSION = 1; 626 | DYLIB_CURRENT_VERSION = 1; 627 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 628 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 629 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 630 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 631 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 632 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 633 | PRODUCT_NAME = DefaultStringConvertible; 634 | SKIP_INSTALL = YES; 635 | }; 636 | name = Release; 637 | }; 638 | 8870AA5C1CCEF912006CE7D0 /* Debug */ = { 639 | isa = XCBuildConfiguration; 640 | buildSettings = { 641 | INFOPLIST_FILE = Tests/Info.plist; 642 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 643 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertibleTests; 644 | PRODUCT_NAME = "$(TARGET_NAME)"; 645 | }; 646 | name = Debug; 647 | }; 648 | 8870AA5D1CCEF912006CE7D0 /* Release */ = { 649 | isa = XCBuildConfiguration; 650 | buildSettings = { 651 | INFOPLIST_FILE = Tests/Info.plist; 652 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 653 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertibleTests; 654 | PRODUCT_NAME = "$(TARGET_NAME)"; 655 | }; 656 | name = Release; 657 | }; 658 | 8870AA821CCEFD66006CE7D0 /* Debug */ = { 659 | isa = XCBuildConfiguration; 660 | buildSettings = { 661 | CODE_SIGN_IDENTITY = "-"; 662 | COMBINE_HIDPI_IMAGES = YES; 663 | DEFINES_MODULE = YES; 664 | DYLIB_COMPATIBILITY_VERSION = 1; 665 | DYLIB_CURRENT_VERSION = 1; 666 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 667 | FRAMEWORK_VERSION = A; 668 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 669 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 670 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 671 | MACOSX_DEPLOYMENT_TARGET = 10.10; 672 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 673 | PRODUCT_NAME = DefaultStringConvertible; 674 | SDKROOT = macosx; 675 | SKIP_INSTALL = YES; 676 | }; 677 | name = Debug; 678 | }; 679 | 8870AA831CCEFD66006CE7D0 /* Release */ = { 680 | isa = XCBuildConfiguration; 681 | buildSettings = { 682 | CODE_SIGN_IDENTITY = "-"; 683 | COMBINE_HIDPI_IMAGES = YES; 684 | DEFINES_MODULE = YES; 685 | DYLIB_COMPATIBILITY_VERSION = 1; 686 | DYLIB_CURRENT_VERSION = 1; 687 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 688 | FRAMEWORK_VERSION = A; 689 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 690 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 691 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 692 | MACOSX_DEPLOYMENT_TARGET = 10.10; 693 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 694 | PRODUCT_NAME = DefaultStringConvertible; 695 | SDKROOT = macosx; 696 | SKIP_INSTALL = YES; 697 | }; 698 | name = Release; 699 | }; 700 | 8870AA851CCEFD66006CE7D0 /* Debug */ = { 701 | isa = XCBuildConfiguration; 702 | buildSettings = { 703 | CODE_SIGN_IDENTITY = "-"; 704 | COMBINE_HIDPI_IMAGES = YES; 705 | INFOPLIST_FILE = Tests/Info.plist; 706 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 707 | MACOSX_DEPLOYMENT_TARGET = 10.11; 708 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-OSXTests"; 709 | PRODUCT_NAME = "$(TARGET_NAME)"; 710 | SDKROOT = macosx; 711 | }; 712 | name = Debug; 713 | }; 714 | 8870AA861CCEFD66006CE7D0 /* Release */ = { 715 | isa = XCBuildConfiguration; 716 | buildSettings = { 717 | CODE_SIGN_IDENTITY = "-"; 718 | COMBINE_HIDPI_IMAGES = YES; 719 | INFOPLIST_FILE = Tests/Info.plist; 720 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 721 | MACOSX_DEPLOYMENT_TARGET = 10.11; 722 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-OSXTests"; 723 | PRODUCT_NAME = "$(TARGET_NAME)"; 724 | SDKROOT = macosx; 725 | }; 726 | name = Release; 727 | }; 728 | 8870AAA11CCEFE38006CE7D0 /* Debug */ = { 729 | isa = XCBuildConfiguration; 730 | buildSettings = { 731 | DEFINES_MODULE = YES; 732 | DYLIB_COMPATIBILITY_VERSION = 1; 733 | DYLIB_CURRENT_VERSION = 1; 734 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 735 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 736 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 737 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 738 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 739 | PRODUCT_NAME = DefaultStringConvertible; 740 | SDKROOT = appletvos; 741 | SKIP_INSTALL = YES; 742 | TARGETED_DEVICE_FAMILY = 3; 743 | TVOS_DEPLOYMENT_TARGET = 9.0; 744 | }; 745 | name = Debug; 746 | }; 747 | 8870AAA21CCEFE38006CE7D0 /* Release */ = { 748 | isa = XCBuildConfiguration; 749 | buildSettings = { 750 | DEFINES_MODULE = YES; 751 | DYLIB_COMPATIBILITY_VERSION = 1; 752 | DYLIB_CURRENT_VERSION = 1; 753 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 754 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 755 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 756 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 757 | PRODUCT_BUNDLE_IDENTIFIER = com.hexedbits.DefaultStringConvertible; 758 | PRODUCT_NAME = DefaultStringConvertible; 759 | SDKROOT = appletvos; 760 | SKIP_INSTALL = YES; 761 | TARGETED_DEVICE_FAMILY = 3; 762 | TVOS_DEPLOYMENT_TARGET = 9.0; 763 | }; 764 | name = Release; 765 | }; 766 | 8870AAA41CCEFE38006CE7D0 /* Debug */ = { 767 | isa = XCBuildConfiguration; 768 | buildSettings = { 769 | INFOPLIST_FILE = Tests/Info.plist; 770 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 771 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-tvOSTests"; 772 | PRODUCT_NAME = "$(TARGET_NAME)"; 773 | SDKROOT = appletvos; 774 | TVOS_DEPLOYMENT_TARGET = 9.2; 775 | }; 776 | name = Debug; 777 | }; 778 | 8870AAA51CCEFE38006CE7D0 /* Release */ = { 779 | isa = XCBuildConfiguration; 780 | buildSettings = { 781 | INFOPLIST_FILE = Tests/Info.plist; 782 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 783 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-tvOSTests"; 784 | PRODUCT_NAME = "$(TARGET_NAME)"; 785 | SDKROOT = appletvos; 786 | TVOS_DEPLOYMENT_TARGET = 9.2; 787 | }; 788 | name = Release; 789 | }; 790 | 8870AAC01CCEFF41006CE7D0 /* Debug */ = { 791 | isa = XCBuildConfiguration; 792 | buildSettings = { 793 | APPLICATION_EXTENSION_API_ONLY = YES; 794 | DEFINES_MODULE = YES; 795 | DYLIB_COMPATIBILITY_VERSION = 1; 796 | DYLIB_CURRENT_VERSION = 1; 797 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 798 | INFOPLIST_FILE = Sources/Info.plist; 799 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 800 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 801 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-watchOS"; 802 | PRODUCT_NAME = DefaultStringConvertible; 803 | SDKROOT = watchos; 804 | SKIP_INSTALL = YES; 805 | TARGETED_DEVICE_FAMILY = 4; 806 | WATCHOS_DEPLOYMENT_TARGET = 2.2; 807 | }; 808 | name = Debug; 809 | }; 810 | 8870AAC11CCEFF41006CE7D0 /* Release */ = { 811 | isa = XCBuildConfiguration; 812 | buildSettings = { 813 | APPLICATION_EXTENSION_API_ONLY = YES; 814 | DEFINES_MODULE = YES; 815 | DYLIB_COMPATIBILITY_VERSION = 1; 816 | DYLIB_CURRENT_VERSION = 1; 817 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 818 | INFOPLIST_FILE = Sources/Info.plist; 819 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 820 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 821 | PRODUCT_BUNDLE_IDENTIFIER = "com.hexedbits.DefaultStringConvertible-watchOS"; 822 | PRODUCT_NAME = DefaultStringConvertible; 823 | SDKROOT = watchos; 824 | SKIP_INSTALL = YES; 825 | TARGETED_DEVICE_FAMILY = 4; 826 | WATCHOS_DEPLOYMENT_TARGET = 2.2; 827 | }; 828 | name = Release; 829 | }; 830 | /* End XCBuildConfiguration section */ 831 | 832 | /* Begin XCConfigurationList section */ 833 | 8870AA3E1CCEF912006CE7D0 /* Build configuration list for PBXProject "DefaultStringConvertible" */ = { 834 | isa = XCConfigurationList; 835 | buildConfigurations = ( 836 | 8870AA561CCEF912006CE7D0 /* Debug */, 837 | 8870AA571CCEF912006CE7D0 /* Release */, 838 | ); 839 | defaultConfigurationIsVisible = 0; 840 | defaultConfigurationName = Release; 841 | }; 842 | 8870AA581CCEF912006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-iOS" */ = { 843 | isa = XCConfigurationList; 844 | buildConfigurations = ( 845 | 8870AA591CCEF912006CE7D0 /* Debug */, 846 | 8870AA5A1CCEF912006CE7D0 /* Release */, 847 | ); 848 | defaultConfigurationIsVisible = 0; 849 | defaultConfigurationName = Release; 850 | }; 851 | 8870AA5B1CCEF912006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-iOSTests" */ = { 852 | isa = XCConfigurationList; 853 | buildConfigurations = ( 854 | 8870AA5C1CCEF912006CE7D0 /* Debug */, 855 | 8870AA5D1CCEF912006CE7D0 /* Release */, 856 | ); 857 | defaultConfigurationIsVisible = 0; 858 | defaultConfigurationName = Release; 859 | }; 860 | 8870AA811CCEFD66006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-OSX" */ = { 861 | isa = XCConfigurationList; 862 | buildConfigurations = ( 863 | 8870AA821CCEFD66006CE7D0 /* Debug */, 864 | 8870AA831CCEFD66006CE7D0 /* Release */, 865 | ); 866 | defaultConfigurationIsVisible = 0; 867 | defaultConfigurationName = Release; 868 | }; 869 | 8870AA841CCEFD66006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-OSXTests" */ = { 870 | isa = XCConfigurationList; 871 | buildConfigurations = ( 872 | 8870AA851CCEFD66006CE7D0 /* Debug */, 873 | 8870AA861CCEFD66006CE7D0 /* Release */, 874 | ); 875 | defaultConfigurationIsVisible = 0; 876 | defaultConfigurationName = Release; 877 | }; 878 | 8870AAA01CCEFE38006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-tvOS" */ = { 879 | isa = XCConfigurationList; 880 | buildConfigurations = ( 881 | 8870AAA11CCEFE38006CE7D0 /* Debug */, 882 | 8870AAA21CCEFE38006CE7D0 /* Release */, 883 | ); 884 | defaultConfigurationIsVisible = 0; 885 | defaultConfigurationName = Release; 886 | }; 887 | 8870AAA31CCEFE38006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-tvOSTests" */ = { 888 | isa = XCConfigurationList; 889 | buildConfigurations = ( 890 | 8870AAA41CCEFE38006CE7D0 /* Debug */, 891 | 8870AAA51CCEFE38006CE7D0 /* Release */, 892 | ); 893 | defaultConfigurationIsVisible = 0; 894 | defaultConfigurationName = Release; 895 | }; 896 | 8870AAC21CCEFF41006CE7D0 /* Build configuration list for PBXNativeTarget "DefaultStringConvertible-watchOS" */ = { 897 | isa = XCConfigurationList; 898 | buildConfigurations = ( 899 | 8870AAC01CCEFF41006CE7D0 /* Debug */, 900 | 8870AAC11CCEFF41006CE7D0 /* Release */, 901 | ); 902 | defaultConfigurationIsVisible = 0; 903 | defaultConfigurationName = Release; 904 | }; 905 | /* End XCConfigurationList section */ 906 | }; 907 | rootObject = 8870AA3B1CCEF912006CE7D0 /* Project object */; 908 | } 909 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/xcshareddata/xcschemes/DefaultStringConvertible-OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/xcshareddata/xcschemes/DefaultStringConvertible-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/xcshareddata/xcschemes/DefaultStringConvertible-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /DefaultStringConvertible.xcodeproj/xcshareddata/xcschemes/DefaultStringConvertible-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jesse Squires 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/DefaultStringConvertible 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/DefaultStringConvertible 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import PackageDescription 20 | 21 | let package = Package( 22 | name: "DefaultStringConvertible" 23 | ) 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DefaultStringConvertible 2 | [![Build Status](https://secure.travis-ci.org/jessesquires/DefaultStringConvertible.svg)](http://travis-ci.org/jessesquires/DefaultStringConvertible) [![Version Status](https://img.shields.io/cocoapods/v/DefaultStringConvertible.svg)][podLink] [![license MIT](https://img.shields.io/cocoapods/l/DefaultStringConvertible.svg)][mitLink] [![codecov](https://codecov.io/gh/jessesquires/DefaultStringConvertible/branch/develop/graph/badge.svg)](https://codecov.io/gh/jessesquires/DefaultStringConvertible) [![Platform](https://img.shields.io/cocoapods/p/DefaultStringConvertible.svg)][docsLink] [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 3 | 4 | *A default `CustomStringConvertible` implementation for Swift types* 5 | 6 | ## About 7 | 8 | Never implement `var description: String` again. Simply `import DefaultStringConvertible` and conform to `CustomStringConvertible` and get a default type description for free. 9 | 10 | > **This micro-library is based on [this post](http://ericasadun.com/2016/04/18/default-reflection/) from Erica Sadun.** 11 | 12 | ## Requirements 13 | 14 | * Xcode 7.3+ 15 | * iOS 8.0+ 16 | * OSX 10.10+ 17 | * tvOS 9.0+ 18 | * watchOS 2.0+ 19 | * Swift 2.2+ 20 | 21 | ## Installation 22 | 23 | #### [CocoaPods](http://cocoapods.org) (recommended) 24 | 25 | ````ruby 26 | use_frameworks! 27 | 28 | # For latest release in cocoapods 29 | pod 'DefaultStringConvertible' 30 | 31 | # Feeling adventurous? Get the latest on develop 32 | pod 'DefaultStringConvertible', :git => 'https://github.com/jessesquires/DefaultStringConvertible.git', :branch => 'develop' 33 | ```` 34 | 35 | #### [Carthage](https://github.com/Carthage/Carthage) 36 | 37 | ````bash 38 | github "jessesquires/DefaultStringConvertible" 39 | ```` 40 | 41 | ## Documentation 42 | 43 | Read the [docs][docsLink]. Generated with [jazzy](https://github.com/realm/jazzy). Hosted by [GitHub Pages](https://pages.github.com). More information on the [`gh-pages`](https://github.com/jessesquires/DefaultStringConvertible/tree/gh-pages) branch. 44 | 45 | ## Getting Started 46 | 47 | ````swift 48 | import DefaultStringConvertible 49 | 50 | class MyClass: CustomStringConvertible { 51 | // ... 52 | 53 | // You *do not* need to implement `var description: String` 54 | // by importing `DefaultStringConvertible`, you get a default `description` for free 55 | } 56 | ```` 57 | 58 | ## Unit tests 59 | 60 | There's a suite of unit tests for `DefaultStringConvertible`. Run them from Xcode by opening `DefaultStringConvertible.xcodeproj`. These tests are well commented and serve as further documentation for how to use this library. 61 | 62 | ## Contribute 63 | 64 | Please follow these sweet [contribution guidelines](https://github.com/jessesquires/HowToContribute). 65 | 66 | ## Credits 67 | 68 | Created and maintained by [**@jesse_squires**](https://twitter.com/jesse_squires). 69 | 70 | ## License 71 | 72 | `DefaultStringConvertible` is released under an [MIT License][mitLink]. See `LICENSE` for details. 73 | 74 | >**Copyright © 2016-present Jesse Squires.** 75 | 76 | *Please provide attribution, it is greatly appreciated.* 77 | 78 | [podLink]:https://cocoapods.org/pods/DefaultStringConvertible 79 | [docsLink]:http://www.jessesquires.com/DefaultStringConvertible 80 | [mitLink]:http://opensource.org/licenses/MIT 81 | -------------------------------------------------------------------------------- /Sources/DefaultStringConvertible.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/DefaultStringConvertible 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/DefaultStringConvertible 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | #import 20 | 21 | FOUNDATION_EXPORT double DefaultStringConvertibleVersionNumber; 22 | 23 | FOUNDATION_EXPORT const unsigned char DefaultStringConvertibleVersionString[]; 24 | -------------------------------------------------------------------------------- /Sources/DefaultStringConvertible.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/DefaultStringConvertible 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/DefaultStringConvertible 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | 20 | /** 21 | A better default implementation of `description`. 22 | Displays the type name followed by all members with labels. 23 | */ 24 | public extension CustomStringConvertible { 25 | 26 | /// Constructs and returns a detailed description of the receiver via its `Mirror`. 27 | public var defaultDescription: String { 28 | return generateDefaultDescription(self) 29 | } 30 | 31 | /// Constructs and returns a recursive description of the receiver, similar to a Playgrounds sidebar description. 32 | public var deepDescription: String { 33 | return generateDeepDescription(self) 34 | } 35 | 36 | /// Returns the value from `defaultDescription`. 37 | public var description: String { 38 | return defaultDescription 39 | } 40 | } 41 | 42 | 43 | private func generateDefaultDescription(any: Any) -> String { 44 | let mirror = Mirror(reflecting: any) 45 | var children = Array(mirror.children) 46 | 47 | var superclassMirror = mirror.superclassMirror() 48 | repeat { 49 | if let superChildren = superclassMirror?.children { 50 | children.appendContentsOf(superChildren) 51 | } 52 | superclassMirror = superclassMirror?.superclassMirror() 53 | } while superclassMirror != nil 54 | 55 | let chunks = children.map { (label: String?, value: Any) -> String in 56 | if let label = label { 57 | if value is String { 58 | return "\(label): \"\(value)\"" 59 | } 60 | return "\(label): \(value)" 61 | } 62 | return "\(value)" 63 | } 64 | 65 | if chunks.count > 0 { 66 | let chunksString = chunks.joinWithSeparator(", ") 67 | return "\(mirror.subjectType)(\(chunksString))" 68 | } 69 | 70 | return "\(any.dynamicType)" 71 | } 72 | 73 | 74 | private func generateDeepDescription(any: Any) -> String { 75 | 76 | func indentedString(string: String) -> String { 77 | return string.characters 78 | .split("\r") 79 | .map(String.init) 80 | .map { $0.isEmpty ? "" : "\r \($0)" } 81 | .joinWithSeparator("") 82 | } 83 | 84 | func deepUnwrap(any: Any) -> Any? { 85 | let mirror = Mirror(reflecting: any) 86 | 87 | if mirror.displayStyle != .Optional { 88 | return any 89 | } 90 | 91 | if let child = mirror.children.first where child.label == "Some" { 92 | return deepUnwrap(child.value) 93 | } 94 | 95 | return nil 96 | } 97 | 98 | guard let any = deepUnwrap(any) else { 99 | return "nil" 100 | } 101 | 102 | if any is Void { 103 | return "Void" 104 | } 105 | 106 | if let int = any as? Int { 107 | return String(int) 108 | } else if let double = any as? Double { 109 | return String(double) 110 | } else if let float = any as? Float { 111 | return String(float) 112 | } else if let bool = any as? Bool { 113 | return String(bool) 114 | } else if let string = any as? String { 115 | return "\"\(string)\"" 116 | } 117 | 118 | let mirror = Mirror(reflecting: any) 119 | 120 | var properties = Array(mirror.children) 121 | 122 | var typeName = String(mirror.subjectType) 123 | if typeName.hasSuffix(".Type") { 124 | typeName = "" 125 | } else { typeName = "<\(typeName)> " } 126 | 127 | guard let displayStyle = mirror.displayStyle else { 128 | return "\(typeName)\(String(any))" 129 | } 130 | 131 | switch displayStyle { 132 | case .Tuple: 133 | if properties.isEmpty { return "()" } 134 | 135 | var string = "(" 136 | 137 | for (index, property) in properties.enumerate() { 138 | if property.label!.characters.first! == "." { 139 | string += generateDeepDescription(property.value) 140 | } else { 141 | string += "\(property.label!): \(generateDeepDescription(property.value))" 142 | } 143 | 144 | string += (index < properties.count - 1 ? ", " : "") 145 | } 146 | return string + ")" 147 | 148 | case .Collection, .Set: 149 | if properties.isEmpty { return "[]" } 150 | 151 | var string = "[" 152 | 153 | for (index, property) in properties.enumerate() { 154 | string += indentedString(generateDeepDescription(property.value) + (index < properties.count - 1 ? ",\r" : "")) 155 | } 156 | return string + "\r]" 157 | 158 | case .Dictionary: 159 | if properties.isEmpty { 160 | return "[:]" 161 | } 162 | 163 | var string = "[" 164 | for (index, property) in properties.enumerate() { 165 | let pair = Array(Mirror(reflecting: property.value).children) 166 | string += indentedString("\(generateDeepDescription(pair[0].value)): \(generateDeepDescription(pair[1].value))" 167 | + (index < properties.count - 1 ? ",\r" : "")) 168 | } 169 | return string + "\r]" 170 | 171 | case .Enum: 172 | if let any = any as? CustomDebugStringConvertible { 173 | return any.debugDescription 174 | } 175 | 176 | if properties.isEmpty { 177 | return "\(mirror.subjectType)." + String(any) 178 | } 179 | 180 | var string = "\(mirror.subjectType).\(properties.first!.label!)" 181 | let associatedValueString = generateDeepDescription(properties.first!.value) 182 | 183 | if associatedValueString.characters.first! == "(" { 184 | string += associatedValueString 185 | } else { 186 | string += "(\(associatedValueString))" 187 | } 188 | return string 189 | 190 | case .Struct, .Class: 191 | if let any = any as? CustomDebugStringConvertible { 192 | return any.debugDescription 193 | } 194 | 195 | var superclassMirror = mirror.superclassMirror() 196 | repeat { 197 | if let superChildren = superclassMirror?.children { 198 | properties.appendContentsOf(superChildren) 199 | } 200 | 201 | superclassMirror = superclassMirror?.superclassMirror() 202 | } while superclassMirror != nil 203 | 204 | if properties.isEmpty { return "\(typeName)\(String(any))" } 205 | var string = "\(typeName){" 206 | for (index, property) in properties.enumerate() { 207 | string += indentedString("\(property.label!): \(generateDeepDescription(property.value))" + (index < properties.count - 1 ? ",\r" : "")) 208 | } 209 | return string + "\r}" 210 | 211 | case .Optional: 212 | return generateDefaultDescription(any) 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Tests/DefaultStringConvertibleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jesse Squires 3 | // http://www.jessesquires.com 4 | // 5 | // 6 | // Documentation 7 | // http://jessesquires.com/DefaultStringConvertible 8 | // 9 | // 10 | // GitHub 11 | // https://github.com/jessesquires/DefaultStringConvertible 12 | // 13 | // 14 | // License 15 | // Copyright © 2016 Jesse Squires 16 | // Released under an MIT license: http://opensource.org/licenses/MIT 17 | // 18 | 19 | import XCTest 20 | 21 | import DefaultStringConvertible 22 | 23 | 24 | final class DefaultStringConvertibleTests: XCTestCase { 25 | 26 | func test_thatClass_providesDefaultDescription_1() { 27 | let c = MyClass1() 28 | let description = c.description 29 | 30 | XCTAssertEqual(description, "MyClass1(myString: \"my string var\", myInt: 666, myDouble: 42.0, myChar: c)") 31 | print("\n", c, "\n") 32 | } 33 | 34 | func test_thatClass_providesDefaultDescription_2() { 35 | let c = MyClass2() 36 | let description = c.description 37 | 38 | XCTAssertEqual(description, "MyClass2") 39 | print("\n", c, "\n") 40 | } 41 | 42 | func test_thatClass_providesDefaultDescription_3() { 43 | let c = MyClass3() 44 | let description = c.description 45 | 46 | XCTAssertEqual(description, "MyClass3(myBool: true, myString: \"my string var\", myInt: 0, myDouble: 42.0, myChar: c)") 47 | print("\n", c, "\n") 48 | } 49 | 50 | func test_thatClass_providesDefaultDescription_4() { 51 | let c = MyClass4() 52 | let description = c.description 53 | 54 | XCTAssertEqual(description, "MyClass4(myBool: true, myString: \"my string var\", myInt: 0, myDouble: 42.0, myChar: c)") 55 | print("\n", c, "\n") 56 | } 57 | 58 | func test_thatStruct_providesDefaultDescription_1() { 59 | let s = MyStruct1() 60 | let description = s.description 61 | 62 | XCTAssertEqual(description, "MyStruct1(myString: \"my string var\", myInt: 666, myDouble: 42.0, myChar: x, myBool: false)") 63 | print("\n", s, "\n") 64 | } 65 | 66 | func test_thatStruct_providesCustomDescription() { 67 | let v = OtherStruct() 68 | let deepDescription = v.description 69 | 70 | XCTAssertEqual(deepDescription, "OtherStruct: override description") 71 | print("\n", deepDescription, "\n") 72 | 73 | } 74 | 75 | func test_thatStruct_providesDeepDescription() { 76 | let v = SomeStruct(prop1: 4, prop2: "hey there") 77 | let deepDescription = v.deepDescription 78 | 79 | XCTAssertEqual(deepDescription, " {\r prop1: 4,\r prop2: \"hey there\"\r}") 80 | print("\n", deepDescription, "\n") 81 | 82 | } 83 | 84 | func test_thatEnum_providesDeepDescription() { 85 | let v = SomeEnum.Case3(value1: nil) 86 | let deepDescription = v.deepDescription 87 | 88 | XCTAssertEqual(deepDescription, "SomeEnum.Case3(nil)") 89 | print("\n", deepDescription, "\n") 90 | 91 | } 92 | 93 | func test_thatClass_providesDeepDescription() { 94 | let v = SomeClass(prop1: [1, 2, 3], prop2: [0, "hello world", NSDictionary()]) 95 | let deepDescription = v.deepDescription 96 | 97 | XCTAssertEqual(deepDescription, 98 | " {\r prop1: [\r 1,\r 2,\r 3\r ],\r prop2: " 99 | + "[\r 0,\r \"hello world\",\r [:]\r ]\r}") 100 | print("\n", deepDescription, "\n") 101 | } 102 | 103 | func test_thatInherittingClass_providesDeepDescription() { 104 | let v = InheritingClass( 105 | prop1: [0], 106 | prop2: [SomeClass.self, InheritingClass.self], 107 | prop3: .Case2(value1: -1, value2: false), 108 | prop4: NSArray(array: [0, "goodbye", NSNumber(float: 0.66)]), 109 | prop5: (NSNumber(double: 6.66), "nsstringgg") 110 | ) 111 | let deepDescription = v.deepDescription 112 | 113 | XCTAssertEqual(deepDescription, 114 | " {\r prop3: SomeEnum.Case2(-1, false),\r prop4: [\r 0,\r" 115 | + " \"goodbye\",\r 0\r ],\r prop5: (6, \"nsstringgg\"),\r prop1: [\r 0\r ],\r" 116 | + " prop2: [\r SomeClass,\r InheritingClass\r ]\r}") 117 | print("\n", deepDescription, "\n") 118 | } 119 | 120 | func test_thatDictionary_providesDeepDescription() { 121 | let v: [String: Any] = [ 122 | "someClass": SomeClass(prop1: [1, 2, 3], prop2: [0, "hello world"]), 123 | ] 124 | let deepDescription = v.deepDescription 125 | 126 | XCTAssertEqual(deepDescription, 127 | "[\r \"someClass\": {\r prop1: [\r 1,\r 2,\r 3\r" 128 | + " ],\r prop2: [\r 0,\r \"hello world\"\r ]\r }\r]") 129 | print("\n", deepDescription, "\n") 130 | } 131 | } 132 | 133 | 134 | 135 | 136 | 137 | // MARK: Fakes 138 | 139 | class MyClass1: CustomStringConvertible { 140 | 141 | let myString = "my string var" 142 | var myInt = 666 143 | let myDouble = 42.0 144 | let myChar = Character("c") 145 | } 146 | 147 | 148 | class MyClass2: CustomStringConvertible { 149 | 150 | } 151 | 152 | 153 | class MyClass3: MyClass1 { 154 | 155 | let myBool = true 156 | 157 | override init() { 158 | super.init() 159 | myInt = 0 160 | } 161 | } 162 | 163 | 164 | class MyClass4: MyClass3 { 165 | 166 | } 167 | 168 | 169 | struct MyStruct1: CustomStringConvertible { 170 | let myString = "my string var" 171 | var myInt = 666 172 | let myDouble = 42.0 173 | let myChar = Character("x") 174 | let myBool = false 175 | } 176 | 177 | 178 | struct SomeStruct: CustomStringConvertible { 179 | let prop1: Int 180 | let prop2: String 181 | } 182 | 183 | 184 | enum SomeEnum: CustomStringConvertible { 185 | case Case1 186 | case Case2(value1: Int, value2: Bool) 187 | case Case3(value1: String?) 188 | } 189 | 190 | 191 | class SomeClass: CustomStringConvertible { 192 | let prop1: [Int] 193 | var prop2: [Any] 194 | 195 | init(prop1: [Int], prop2: [Any]) { 196 | self.prop1 = prop1 197 | self.prop2 = prop2 198 | } 199 | } 200 | 201 | 202 | class InheritingClass: SomeClass { 203 | let prop3: SomeEnum 204 | let prop4: NSArray 205 | let prop5: (NSNumber, NSString) 206 | 207 | init(prop1: [Int], prop2: [Any], prop3: SomeEnum, prop4: NSArray, prop5: (NSNumber, NSString)) { 208 | self.prop3 = prop3 209 | self.prop4 = prop4 210 | self.prop5 = prop5 211 | super.init(prop1: prop1, prop2: prop2) 212 | } 213 | } 214 | 215 | 216 | struct OtherStruct: CustomStringConvertible { 217 | var description: String { 218 | return "OtherStruct: override description" 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | --------------------------------------------------------------------------------