├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── Annotated.podspec ├── Annotated.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── Annotated-iOS.xcscheme │ ├── Annotated-macOS.xcscheme │ ├── Annotated-tvOS.xcscheme │ └── Annotated-watchOS.xcscheme ├── Assets └── screenshot.png ├── Configs ├── Annotated.plist └── AnnotatedTests.plist ├── Example App ├── Annotated Example.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Annotated Example.xcworkspace │ └── contents.xcworkspacedata └── Annotated Example │ ├── Annotated_ExampleApp.swift │ ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── ContentView.swift │ ├── Info.plist │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── UIKitLabel.swift ├── LICENSE ├── Package.swift ├── README.md ├── Sources ├── Annotated+Annotation.swift ├── Annotated+NSAttributedString.swift ├── Annotated+StringInterpolation.swift ├── Annotated+SwiftUI-Text.swift ├── Annotated.swift └── String+.swift └── Tests ├── AnnotatedTests └── AnnotatedTests.swift └── LinuxMain.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Annotated.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Annotated" 3 | s.version = "0.1.0" 4 | s.summary = "Easy String Annotation" 5 | s.description = <<-DESC 6 | Annotate your Strings, render them in NSAttributedString or Text 7 | DESC 8 | s.homepage = "https://github.com/jegnux/Annotated" 9 | s.license = { :type => "MIT", :file => "LICENSE" } 10 | s.author = { "Jérôme Alves" => "j.alves@me.com" } 11 | s.social_media_url = "" 12 | s.ios.deployment_target = "11.0" 13 | s.osx.deployment_target = "10.10" 14 | s.watchos.deployment_target = "2.0" 15 | s.tvos.deployment_target = "11.0" 16 | s.source = { :git => "https://github.com/jegnux/Annotated.git", :tag => s.version.to_s } 17 | s.source_files = "Sources/**/*" 18 | s.frameworks = "Foundation" 19 | end 20 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 52D6D9871BEFF229002C0205 /* Annotated.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D97C1BEFF229002C0205 /* Annotated.framework */; }; 11 | 75630A2525581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */; }; 12 | 75630A2625581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */; }; 13 | 75630A2725581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */; }; 14 | 75630A2825581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */; }; 15 | 75630A3125581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */; }; 16 | 75630A3225581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */; }; 17 | 75630A3325581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */; }; 18 | 75630A3425581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */; }; 19 | 75630A3D25581D280098C6FE /* Annotated+Annotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */; }; 20 | 75630A3E25581D280098C6FE /* Annotated+Annotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */; }; 21 | 75630A3F25581D280098C6FE /* Annotated+Annotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */; }; 22 | 75630A4025581D280098C6FE /* Annotated+Annotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */; }; 23 | 75F9F69E25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */; }; 24 | 75F9F69F25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */; }; 25 | 75F9F6A025592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */; }; 26 | 75F9F6A125592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */; }; 27 | 75F9F6AA25592AE0001ADEF2 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F6A925592AE0001ADEF2 /* String+.swift */; }; 28 | 75F9F6AB25592AE0001ADEF2 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F6A925592AE0001ADEF2 /* String+.swift */; }; 29 | 75F9F6AC25592AE0001ADEF2 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F6A925592AE0001ADEF2 /* String+.swift */; }; 30 | 75F9F6AD25592AE0001ADEF2 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F6A925592AE0001ADEF2 /* String+.swift */; }; 31 | 8933C7851EB5B820000D00A4 /* Annotated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* Annotated.swift */; }; 32 | 8933C7861EB5B820000D00A4 /* Annotated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* Annotated.swift */; }; 33 | 8933C7871EB5B820000D00A4 /* Annotated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* Annotated.swift */; }; 34 | 8933C7881EB5B820000D00A4 /* Annotated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* Annotated.swift */; }; 35 | 8933C78E1EB5B82C000D00A4 /* AnnotatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* AnnotatedTests.swift */; }; 36 | 8933C78F1EB5B82C000D00A4 /* AnnotatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* AnnotatedTests.swift */; }; 37 | 8933C7901EB5B82D000D00A4 /* AnnotatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* AnnotatedTests.swift */; }; 38 | DD7502881C68FEDE006590AF /* Annotated.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6DA0F1BF000BD002C0205 /* Annotated.framework */; }; 39 | DD7502921C690C7A006590AF /* Annotated.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D9F01BEFFFBE002C0205 /* Annotated.framework */; }; 40 | /* End PBXBuildFile section */ 41 | 42 | /* Begin PBXContainerItemProxy section */ 43 | 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 46 | proxyType = 1; 47 | remoteGlobalIDString = 52D6D97B1BEFF229002C0205; 48 | remoteInfo = Annotated; 49 | }; 50 | DD7502801C68FCFC006590AF /* PBXContainerItemProxy */ = { 51 | isa = PBXContainerItemProxy; 52 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 53 | proxyType = 1; 54 | remoteGlobalIDString = 52D6DA0E1BF000BD002C0205; 55 | remoteInfo = "Annotated-macOS"; 56 | }; 57 | DD7502931C690C7A006590AF /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 60 | proxyType = 1; 61 | remoteGlobalIDString = 52D6D9EF1BEFFFBE002C0205; 62 | remoteInfo = "Annotated-tvOS"; 63 | }; 64 | /* End PBXContainerItemProxy section */ 65 | 66 | /* Begin PBXFileReference section */ 67 | 52D6D97C1BEFF229002C0205 /* Annotated.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Annotated.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 52D6D9861BEFF229002C0205 /* Annotated-iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Annotated-iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 52D6D9E21BEFFF6E002C0205 /* Annotated.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Annotated.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | 52D6D9F01BEFFFBE002C0205 /* Annotated.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Annotated.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 52D6DA0F1BF000BD002C0205 /* Annotated.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Annotated.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Annotated+NSAttributedString.swift"; sourceTree = ""; }; 73 | 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Annotated+StringInterpolation.swift"; sourceTree = ""; }; 74 | 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Annotated+Annotation.swift"; sourceTree = ""; }; 75 | 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Annotated+SwiftUI-Text.swift"; sourceTree = ""; }; 76 | 75F9F6A925592AE0001ADEF2 /* String+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = ""; }; 77 | 8933C7841EB5B820000D00A4 /* Annotated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Annotated.swift; sourceTree = ""; }; 78 | 8933C7891EB5B82A000D00A4 /* AnnotatedTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnnotatedTests.swift; sourceTree = ""; }; 79 | AD2FAA261CD0B6D800659CF4 /* Annotated.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Annotated.plist; sourceTree = ""; }; 80 | AD2FAA281CD0B6E100659CF4 /* AnnotatedTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AnnotatedTests.plist; sourceTree = ""; }; 81 | DD75027A1C68FCFC006590AF /* Annotated-macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Annotated-macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 82 | DD75028D1C690C7A006590AF /* Annotated-tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Annotated-tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | 52D6D9781BEFF229002C0205 /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | 52D6D9831BEFF229002C0205 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | 52D6D9871BEFF229002C0205 /* Annotated.framework in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */ = { 109 | isa = PBXFrameworksBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | 52D6DA0B1BF000BD002C0205 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | DD7502771C68FCFC006590AF /* Frameworks */ = { 123 | isa = PBXFrameworksBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | DD7502881C68FEDE006590AF /* Annotated.framework in Frameworks */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | DD75028A1C690C7A006590AF /* Frameworks */ = { 131 | isa = PBXFrameworksBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | DD7502921C690C7A006590AF /* Annotated.framework in Frameworks */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXFrameworksBuildPhase section */ 139 | 140 | /* Begin PBXGroup section */ 141 | 52D6D9721BEFF229002C0205 = { 142 | isa = PBXGroup; 143 | children = ( 144 | 8933C7811EB5B7E0000D00A4 /* Sources */, 145 | 8933C7831EB5B7EB000D00A4 /* Tests */, 146 | 52D6D99C1BEFF38C002C0205 /* Configs */, 147 | 52D6D97D1BEFF229002C0205 /* Products */, 148 | ); 149 | sourceTree = ""; 150 | }; 151 | 52D6D97D1BEFF229002C0205 /* Products */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 52D6D97C1BEFF229002C0205 /* Annotated.framework */, 155 | 52D6D9861BEFF229002C0205 /* Annotated-iOS Tests.xctest */, 156 | 52D6D9E21BEFFF6E002C0205 /* Annotated.framework */, 157 | 52D6D9F01BEFFFBE002C0205 /* Annotated.framework */, 158 | 52D6DA0F1BF000BD002C0205 /* Annotated.framework */, 159 | DD75027A1C68FCFC006590AF /* Annotated-macOS Tests.xctest */, 160 | DD75028D1C690C7A006590AF /* Annotated-tvOS Tests.xctest */, 161 | ); 162 | name = Products; 163 | sourceTree = ""; 164 | }; 165 | 52D6D99C1BEFF38C002C0205 /* Configs */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | DD7502721C68FC1B006590AF /* Frameworks */, 169 | DD7502731C68FC20006590AF /* Tests */, 170 | ); 171 | path = Configs; 172 | sourceTree = ""; 173 | }; 174 | 8933C7811EB5B7E0000D00A4 /* Sources */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 8933C7841EB5B820000D00A4 /* Annotated.swift */, 178 | 75630A3C25581D280098C6FE /* Annotated+Annotation.swift */, 179 | 75630A3025581BE00098C6FE /* Annotated+StringInterpolation.swift */, 180 | 75630A2425581BBB0098C6FE /* Annotated+NSAttributedString.swift */, 181 | 75F9F69D25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift */, 182 | 75F9F6A925592AE0001ADEF2 /* String+.swift */, 183 | ); 184 | path = Sources; 185 | sourceTree = ""; 186 | }; 187 | 8933C7831EB5B7EB000D00A4 /* Tests */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 8933C7891EB5B82A000D00A4 /* AnnotatedTests.swift */, 191 | ); 192 | name = Tests; 193 | path = Tests/AnnotatedTests; 194 | sourceTree = ""; 195 | }; 196 | DD7502721C68FC1B006590AF /* Frameworks */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | AD2FAA261CD0B6D800659CF4 /* Annotated.plist */, 200 | ); 201 | name = Frameworks; 202 | sourceTree = ""; 203 | }; 204 | DD7502731C68FC20006590AF /* Tests */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | AD2FAA281CD0B6E100659CF4 /* AnnotatedTests.plist */, 208 | ); 209 | name = Tests; 210 | sourceTree = ""; 211 | }; 212 | /* End PBXGroup section */ 213 | 214 | /* Begin PBXHeadersBuildPhase section */ 215 | 52D6D9791BEFF229002C0205 /* Headers */ = { 216 | isa = PBXHeadersBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | 52D6D9DF1BEFFF6E002C0205 /* Headers */ = { 223 | isa = PBXHeadersBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | 52D6D9ED1BEFFFBE002C0205 /* Headers */ = { 230 | isa = PBXHeadersBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | 52D6DA0C1BF000BD002C0205 /* Headers */ = { 237 | isa = PBXHeadersBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXHeadersBuildPhase section */ 244 | 245 | /* Begin PBXNativeTarget section */ 246 | 52D6D97B1BEFF229002C0205 /* Annotated-iOS */ = { 247 | isa = PBXNativeTarget; 248 | buildConfigurationList = 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "Annotated-iOS" */; 249 | buildPhases = ( 250 | 52D6D9771BEFF229002C0205 /* Sources */, 251 | 52D6D9781BEFF229002C0205 /* Frameworks */, 252 | 52D6D9791BEFF229002C0205 /* Headers */, 253 | 52D6D97A1BEFF229002C0205 /* Resources */, 254 | ); 255 | buildRules = ( 256 | ); 257 | dependencies = ( 258 | ); 259 | name = "Annotated-iOS"; 260 | productName = Annotated; 261 | productReference = 52D6D97C1BEFF229002C0205 /* Annotated.framework */; 262 | productType = "com.apple.product-type.framework"; 263 | }; 264 | 52D6D9851BEFF229002C0205 /* Annotated-iOS Tests */ = { 265 | isa = PBXNativeTarget; 266 | buildConfigurationList = 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "Annotated-iOS Tests" */; 267 | buildPhases = ( 268 | 52D6D9821BEFF229002C0205 /* Sources */, 269 | 52D6D9831BEFF229002C0205 /* Frameworks */, 270 | 52D6D9841BEFF229002C0205 /* Resources */, 271 | ); 272 | buildRules = ( 273 | ); 274 | dependencies = ( 275 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */, 276 | ); 277 | name = "Annotated-iOS Tests"; 278 | productName = AnnotatedTests; 279 | productReference = 52D6D9861BEFF229002C0205 /* Annotated-iOS Tests.xctest */; 280 | productType = "com.apple.product-type.bundle.unit-test"; 281 | }; 282 | 52D6D9E11BEFFF6E002C0205 /* Annotated-watchOS */ = { 283 | isa = PBXNativeTarget; 284 | buildConfigurationList = 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "Annotated-watchOS" */; 285 | buildPhases = ( 286 | 52D6D9DD1BEFFF6E002C0205 /* Sources */, 287 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */, 288 | 52D6D9DF1BEFFF6E002C0205 /* Headers */, 289 | 52D6D9E01BEFFF6E002C0205 /* Resources */, 290 | ); 291 | buildRules = ( 292 | ); 293 | dependencies = ( 294 | ); 295 | name = "Annotated-watchOS"; 296 | productName = "Annotated-watchOS"; 297 | productReference = 52D6D9E21BEFFF6E002C0205 /* Annotated.framework */; 298 | productType = "com.apple.product-type.framework"; 299 | }; 300 | 52D6D9EF1BEFFFBE002C0205 /* Annotated-tvOS */ = { 301 | isa = PBXNativeTarget; 302 | buildConfigurationList = 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "Annotated-tvOS" */; 303 | buildPhases = ( 304 | 52D6D9EB1BEFFFBE002C0205 /* Sources */, 305 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */, 306 | 52D6D9ED1BEFFFBE002C0205 /* Headers */, 307 | 52D6D9EE1BEFFFBE002C0205 /* Resources */, 308 | ); 309 | buildRules = ( 310 | ); 311 | dependencies = ( 312 | ); 313 | name = "Annotated-tvOS"; 314 | productName = "Annotated-tvOS"; 315 | productReference = 52D6D9F01BEFFFBE002C0205 /* Annotated.framework */; 316 | productType = "com.apple.product-type.framework"; 317 | }; 318 | 52D6DA0E1BF000BD002C0205 /* Annotated-macOS */ = { 319 | isa = PBXNativeTarget; 320 | buildConfigurationList = 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "Annotated-macOS" */; 321 | buildPhases = ( 322 | 52D6DA0A1BF000BD002C0205 /* Sources */, 323 | 52D6DA0B1BF000BD002C0205 /* Frameworks */, 324 | 52D6DA0C1BF000BD002C0205 /* Headers */, 325 | 52D6DA0D1BF000BD002C0205 /* Resources */, 326 | ); 327 | buildRules = ( 328 | ); 329 | dependencies = ( 330 | ); 331 | name = "Annotated-macOS"; 332 | productName = "Annotated-macOS"; 333 | productReference = 52D6DA0F1BF000BD002C0205 /* Annotated.framework */; 334 | productType = "com.apple.product-type.framework"; 335 | }; 336 | DD7502791C68FCFC006590AF /* Annotated-macOS Tests */ = { 337 | isa = PBXNativeTarget; 338 | buildConfigurationList = DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "Annotated-macOS Tests" */; 339 | buildPhases = ( 340 | DD7502761C68FCFC006590AF /* Sources */, 341 | DD7502771C68FCFC006590AF /* Frameworks */, 342 | DD7502781C68FCFC006590AF /* Resources */, 343 | ); 344 | buildRules = ( 345 | ); 346 | dependencies = ( 347 | DD7502811C68FCFC006590AF /* PBXTargetDependency */, 348 | ); 349 | name = "Annotated-macOS Tests"; 350 | productName = "Annotated-OS Tests"; 351 | productReference = DD75027A1C68FCFC006590AF /* Annotated-macOS Tests.xctest */; 352 | productType = "com.apple.product-type.bundle.unit-test"; 353 | }; 354 | DD75028C1C690C7A006590AF /* Annotated-tvOS Tests */ = { 355 | isa = PBXNativeTarget; 356 | buildConfigurationList = DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "Annotated-tvOS Tests" */; 357 | buildPhases = ( 358 | DD7502891C690C7A006590AF /* Sources */, 359 | DD75028A1C690C7A006590AF /* Frameworks */, 360 | DD75028B1C690C7A006590AF /* Resources */, 361 | ); 362 | buildRules = ( 363 | ); 364 | dependencies = ( 365 | DD7502941C690C7A006590AF /* PBXTargetDependency */, 366 | ); 367 | name = "Annotated-tvOS Tests"; 368 | productName = "Annotated-tvOS Tests"; 369 | productReference = DD75028D1C690C7A006590AF /* Annotated-tvOS Tests.xctest */; 370 | productType = "com.apple.product-type.bundle.unit-test"; 371 | }; 372 | /* End PBXNativeTarget section */ 373 | 374 | /* Begin PBXProject section */ 375 | 52D6D9731BEFF229002C0205 /* Project object */ = { 376 | isa = PBXProject; 377 | attributes = { 378 | LastSwiftUpdateCheck = 0720; 379 | LastUpgradeCheck = 1220; 380 | ORGANIZATIONNAME = Annotated; 381 | TargetAttributes = { 382 | 52D6D97B1BEFF229002C0205 = { 383 | CreatedOnToolsVersion = 7.1; 384 | LastSwiftMigration = 1020; 385 | }; 386 | 52D6D9851BEFF229002C0205 = { 387 | CreatedOnToolsVersion = 7.1; 388 | LastSwiftMigration = 1020; 389 | }; 390 | 52D6D9E11BEFFF6E002C0205 = { 391 | CreatedOnToolsVersion = 7.1; 392 | LastSwiftMigration = 1020; 393 | }; 394 | 52D6D9EF1BEFFFBE002C0205 = { 395 | CreatedOnToolsVersion = 7.1; 396 | LastSwiftMigration = 1020; 397 | }; 398 | 52D6DA0E1BF000BD002C0205 = { 399 | CreatedOnToolsVersion = 7.1; 400 | LastSwiftMigration = 1020; 401 | }; 402 | DD7502791C68FCFC006590AF = { 403 | CreatedOnToolsVersion = 7.2.1; 404 | LastSwiftMigration = 1020; 405 | }; 406 | DD75028C1C690C7A006590AF = { 407 | CreatedOnToolsVersion = 7.2.1; 408 | LastSwiftMigration = 1020; 409 | }; 410 | }; 411 | }; 412 | buildConfigurationList = 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "Annotated" */; 413 | compatibilityVersion = "Xcode 6.3"; 414 | developmentRegion = en; 415 | hasScannedForEncodings = 0; 416 | knownRegions = ( 417 | en, 418 | Base, 419 | ); 420 | mainGroup = 52D6D9721BEFF229002C0205; 421 | productRefGroup = 52D6D97D1BEFF229002C0205 /* Products */; 422 | projectDirPath = ""; 423 | projectRoot = ""; 424 | targets = ( 425 | 52D6D97B1BEFF229002C0205 /* Annotated-iOS */, 426 | 52D6DA0E1BF000BD002C0205 /* Annotated-macOS */, 427 | 52D6D9E11BEFFF6E002C0205 /* Annotated-watchOS */, 428 | 52D6D9EF1BEFFFBE002C0205 /* Annotated-tvOS */, 429 | 52D6D9851BEFF229002C0205 /* Annotated-iOS Tests */, 430 | DD7502791C68FCFC006590AF /* Annotated-macOS Tests */, 431 | DD75028C1C690C7A006590AF /* Annotated-tvOS Tests */, 432 | ); 433 | }; 434 | /* End PBXProject section */ 435 | 436 | /* Begin PBXResourcesBuildPhase section */ 437 | 52D6D97A1BEFF229002C0205 /* Resources */ = { 438 | isa = PBXResourcesBuildPhase; 439 | buildActionMask = 2147483647; 440 | files = ( 441 | ); 442 | runOnlyForDeploymentPostprocessing = 0; 443 | }; 444 | 52D6D9841BEFF229002C0205 /* Resources */ = { 445 | isa = PBXResourcesBuildPhase; 446 | buildActionMask = 2147483647; 447 | files = ( 448 | ); 449 | runOnlyForDeploymentPostprocessing = 0; 450 | }; 451 | 52D6D9E01BEFFF6E002C0205 /* Resources */ = { 452 | isa = PBXResourcesBuildPhase; 453 | buildActionMask = 2147483647; 454 | files = ( 455 | ); 456 | runOnlyForDeploymentPostprocessing = 0; 457 | }; 458 | 52D6D9EE1BEFFFBE002C0205 /* Resources */ = { 459 | isa = PBXResourcesBuildPhase; 460 | buildActionMask = 2147483647; 461 | files = ( 462 | ); 463 | runOnlyForDeploymentPostprocessing = 0; 464 | }; 465 | 52D6DA0D1BF000BD002C0205 /* Resources */ = { 466 | isa = PBXResourcesBuildPhase; 467 | buildActionMask = 2147483647; 468 | files = ( 469 | ); 470 | runOnlyForDeploymentPostprocessing = 0; 471 | }; 472 | DD7502781C68FCFC006590AF /* Resources */ = { 473 | isa = PBXResourcesBuildPhase; 474 | buildActionMask = 2147483647; 475 | files = ( 476 | ); 477 | runOnlyForDeploymentPostprocessing = 0; 478 | }; 479 | DD75028B1C690C7A006590AF /* Resources */ = { 480 | isa = PBXResourcesBuildPhase; 481 | buildActionMask = 2147483647; 482 | files = ( 483 | ); 484 | runOnlyForDeploymentPostprocessing = 0; 485 | }; 486 | /* End PBXResourcesBuildPhase section */ 487 | 488 | /* Begin PBXSourcesBuildPhase section */ 489 | 52D6D9771BEFF229002C0205 /* Sources */ = { 490 | isa = PBXSourcesBuildPhase; 491 | buildActionMask = 2147483647; 492 | files = ( 493 | 75630A2525581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */, 494 | 75630A3D25581D280098C6FE /* Annotated+Annotation.swift in Sources */, 495 | 75F9F69E25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */, 496 | 75630A3125581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */, 497 | 75F9F6AA25592AE0001ADEF2 /* String+.swift in Sources */, 498 | 8933C7851EB5B820000D00A4 /* Annotated.swift in Sources */, 499 | ); 500 | runOnlyForDeploymentPostprocessing = 0; 501 | }; 502 | 52D6D9821BEFF229002C0205 /* Sources */ = { 503 | isa = PBXSourcesBuildPhase; 504 | buildActionMask = 2147483647; 505 | files = ( 506 | 8933C7901EB5B82D000D00A4 /* AnnotatedTests.swift in Sources */, 507 | ); 508 | runOnlyForDeploymentPostprocessing = 0; 509 | }; 510 | 52D6D9DD1BEFFF6E002C0205 /* Sources */ = { 511 | isa = PBXSourcesBuildPhase; 512 | buildActionMask = 2147483647; 513 | files = ( 514 | 75630A2725581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */, 515 | 75630A3F25581D280098C6FE /* Annotated+Annotation.swift in Sources */, 516 | 75F9F6A025592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */, 517 | 75630A3325581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */, 518 | 75F9F6AC25592AE0001ADEF2 /* String+.swift in Sources */, 519 | 8933C7871EB5B820000D00A4 /* Annotated.swift in Sources */, 520 | ); 521 | runOnlyForDeploymentPostprocessing = 0; 522 | }; 523 | 52D6D9EB1BEFFFBE002C0205 /* Sources */ = { 524 | isa = PBXSourcesBuildPhase; 525 | buildActionMask = 2147483647; 526 | files = ( 527 | 75630A2825581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */, 528 | 75630A4025581D280098C6FE /* Annotated+Annotation.swift in Sources */, 529 | 75F9F6A125592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */, 530 | 75630A3425581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */, 531 | 75F9F6AD25592AE0001ADEF2 /* String+.swift in Sources */, 532 | 8933C7881EB5B820000D00A4 /* Annotated.swift in Sources */, 533 | ); 534 | runOnlyForDeploymentPostprocessing = 0; 535 | }; 536 | 52D6DA0A1BF000BD002C0205 /* Sources */ = { 537 | isa = PBXSourcesBuildPhase; 538 | buildActionMask = 2147483647; 539 | files = ( 540 | 75630A2625581BBB0098C6FE /* Annotated+NSAttributedString.swift in Sources */, 541 | 75630A3E25581D280098C6FE /* Annotated+Annotation.swift in Sources */, 542 | 75F9F69F25592AC6001ADEF2 /* Annotated+SwiftUI-Text.swift in Sources */, 543 | 75630A3225581BE00098C6FE /* Annotated+StringInterpolation.swift in Sources */, 544 | 75F9F6AB25592AE0001ADEF2 /* String+.swift in Sources */, 545 | 8933C7861EB5B820000D00A4 /* Annotated.swift in Sources */, 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | DD7502761C68FCFC006590AF /* Sources */ = { 550 | isa = PBXSourcesBuildPhase; 551 | buildActionMask = 2147483647; 552 | files = ( 553 | 8933C78F1EB5B82C000D00A4 /* AnnotatedTests.swift in Sources */, 554 | ); 555 | runOnlyForDeploymentPostprocessing = 0; 556 | }; 557 | DD7502891C690C7A006590AF /* Sources */ = { 558 | isa = PBXSourcesBuildPhase; 559 | buildActionMask = 2147483647; 560 | files = ( 561 | 8933C78E1EB5B82C000D00A4 /* AnnotatedTests.swift in Sources */, 562 | ); 563 | runOnlyForDeploymentPostprocessing = 0; 564 | }; 565 | /* End PBXSourcesBuildPhase section */ 566 | 567 | /* Begin PBXTargetDependency section */ 568 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */ = { 569 | isa = PBXTargetDependency; 570 | target = 52D6D97B1BEFF229002C0205 /* Annotated-iOS */; 571 | targetProxy = 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */; 572 | }; 573 | DD7502811C68FCFC006590AF /* PBXTargetDependency */ = { 574 | isa = PBXTargetDependency; 575 | target = 52D6DA0E1BF000BD002C0205 /* Annotated-macOS */; 576 | targetProxy = DD7502801C68FCFC006590AF /* PBXContainerItemProxy */; 577 | }; 578 | DD7502941C690C7A006590AF /* PBXTargetDependency */ = { 579 | isa = PBXTargetDependency; 580 | target = 52D6D9EF1BEFFFBE002C0205 /* Annotated-tvOS */; 581 | targetProxy = DD7502931C690C7A006590AF /* PBXContainerItemProxy */; 582 | }; 583 | /* End PBXTargetDependency section */ 584 | 585 | /* Begin XCBuildConfiguration section */ 586 | 52D6D98E1BEFF229002C0205 /* Debug */ = { 587 | isa = XCBuildConfiguration; 588 | buildSettings = { 589 | ALWAYS_SEARCH_USER_PATHS = NO; 590 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 591 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 592 | CLANG_CXX_LIBRARY = "libc++"; 593 | CLANG_ENABLE_MODULES = YES; 594 | CLANG_ENABLE_OBJC_ARC = YES; 595 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 596 | CLANG_WARN_BOOL_CONVERSION = YES; 597 | CLANG_WARN_COMMA = YES; 598 | CLANG_WARN_CONSTANT_CONVERSION = YES; 599 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 600 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 601 | CLANG_WARN_EMPTY_BODY = YES; 602 | CLANG_WARN_ENUM_CONVERSION = YES; 603 | CLANG_WARN_INFINITE_RECURSION = YES; 604 | CLANG_WARN_INT_CONVERSION = YES; 605 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 606 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 607 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 608 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 609 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 610 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 611 | CLANG_WARN_STRICT_PROTOTYPES = YES; 612 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 613 | CLANG_WARN_UNREACHABLE_CODE = YES; 614 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 615 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 616 | COPY_PHASE_STRIP = NO; 617 | CURRENT_PROJECT_VERSION = 1; 618 | DEBUG_INFORMATION_FORMAT = dwarf; 619 | ENABLE_STRICT_OBJC_MSGSEND = YES; 620 | ENABLE_TESTABILITY = YES; 621 | GCC_C_LANGUAGE_STANDARD = gnu99; 622 | GCC_DYNAMIC_NO_PIC = NO; 623 | GCC_NO_COMMON_BLOCKS = YES; 624 | GCC_OPTIMIZATION_LEVEL = 0; 625 | GCC_PREPROCESSOR_DEFINITIONS = ( 626 | "DEBUG=1", 627 | "$(inherited)", 628 | ); 629 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 630 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 631 | GCC_WARN_UNDECLARED_SELECTOR = YES; 632 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 633 | GCC_WARN_UNUSED_FUNCTION = YES; 634 | GCC_WARN_UNUSED_VARIABLE = YES; 635 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 636 | MTL_ENABLE_DEBUG_INFO = YES; 637 | ONLY_ACTIVE_ARCH = YES; 638 | SDKROOT = iphoneos; 639 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 640 | SWIFT_VERSION = 5.0; 641 | TARGETED_DEVICE_FAMILY = "1,2"; 642 | VERSIONING_SYSTEM = "apple-generic"; 643 | VERSION_INFO_PREFIX = ""; 644 | }; 645 | name = Debug; 646 | }; 647 | 52D6D98F1BEFF229002C0205 /* Release */ = { 648 | isa = XCBuildConfiguration; 649 | buildSettings = { 650 | ALWAYS_SEARCH_USER_PATHS = NO; 651 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 652 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 653 | CLANG_CXX_LIBRARY = "libc++"; 654 | CLANG_ENABLE_MODULES = YES; 655 | CLANG_ENABLE_OBJC_ARC = YES; 656 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 657 | CLANG_WARN_BOOL_CONVERSION = YES; 658 | CLANG_WARN_COMMA = YES; 659 | CLANG_WARN_CONSTANT_CONVERSION = YES; 660 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 661 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 662 | CLANG_WARN_EMPTY_BODY = YES; 663 | CLANG_WARN_ENUM_CONVERSION = YES; 664 | CLANG_WARN_INFINITE_RECURSION = YES; 665 | CLANG_WARN_INT_CONVERSION = YES; 666 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 667 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 668 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 669 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 670 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 671 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 672 | CLANG_WARN_STRICT_PROTOTYPES = YES; 673 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 674 | CLANG_WARN_UNREACHABLE_CODE = YES; 675 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 676 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 677 | COPY_PHASE_STRIP = NO; 678 | CURRENT_PROJECT_VERSION = 1; 679 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 680 | ENABLE_NS_ASSERTIONS = NO; 681 | ENABLE_STRICT_OBJC_MSGSEND = YES; 682 | GCC_C_LANGUAGE_STANDARD = gnu99; 683 | GCC_NO_COMMON_BLOCKS = YES; 684 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 685 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 686 | GCC_WARN_UNDECLARED_SELECTOR = YES; 687 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 688 | GCC_WARN_UNUSED_FUNCTION = YES; 689 | GCC_WARN_UNUSED_VARIABLE = YES; 690 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 691 | MTL_ENABLE_DEBUG_INFO = NO; 692 | SDKROOT = iphoneos; 693 | SWIFT_VERSION = 5.0; 694 | TARGETED_DEVICE_FAMILY = "1,2"; 695 | VALIDATE_PRODUCT = YES; 696 | VERSIONING_SYSTEM = "apple-generic"; 697 | VERSION_INFO_PREFIX = ""; 698 | }; 699 | name = Release; 700 | }; 701 | 52D6D9911BEFF229002C0205 /* Debug */ = { 702 | isa = XCBuildConfiguration; 703 | buildSettings = { 704 | APPLICATION_EXTENSION_API_ONLY = YES; 705 | CLANG_ENABLE_MODULES = YES; 706 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 707 | DEFINES_MODULE = YES; 708 | DYLIB_COMPATIBILITY_VERSION = 1; 709 | DYLIB_CURRENT_VERSION = 1; 710 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 711 | INFOPLIST_FILE = Configs/Annotated.plist; 712 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 713 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 714 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 715 | ONLY_ACTIVE_ARCH = NO; 716 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-iOS"; 717 | PRODUCT_NAME = Annotated; 718 | SKIP_INSTALL = YES; 719 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 720 | SWIFT_VERSION = 5.0; 721 | }; 722 | name = Debug; 723 | }; 724 | 52D6D9921BEFF229002C0205 /* Release */ = { 725 | isa = XCBuildConfiguration; 726 | buildSettings = { 727 | APPLICATION_EXTENSION_API_ONLY = YES; 728 | CLANG_ENABLE_MODULES = YES; 729 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 730 | DEFINES_MODULE = YES; 731 | DYLIB_COMPATIBILITY_VERSION = 1; 732 | DYLIB_CURRENT_VERSION = 1; 733 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 734 | INFOPLIST_FILE = Configs/Annotated.plist; 735 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 736 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 737 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 738 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-iOS"; 739 | PRODUCT_NAME = Annotated; 740 | SKIP_INSTALL = YES; 741 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 742 | SWIFT_VERSION = 5.0; 743 | }; 744 | name = Release; 745 | }; 746 | 52D6D9941BEFF229002C0205 /* Debug */ = { 747 | isa = XCBuildConfiguration; 748 | buildSettings = { 749 | CLANG_ENABLE_MODULES = YES; 750 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 751 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 752 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-iOS-Tests"; 753 | PRODUCT_NAME = "$(TARGET_NAME)"; 754 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 755 | SWIFT_VERSION = 5.0; 756 | }; 757 | name = Debug; 758 | }; 759 | 52D6D9951BEFF229002C0205 /* Release */ = { 760 | isa = XCBuildConfiguration; 761 | buildSettings = { 762 | CLANG_ENABLE_MODULES = YES; 763 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 764 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 765 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-iOS-Tests"; 766 | PRODUCT_NAME = "$(TARGET_NAME)"; 767 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 768 | SWIFT_VERSION = 5.0; 769 | }; 770 | name = Release; 771 | }; 772 | 52D6D9E81BEFFF6E002C0205 /* Debug */ = { 773 | isa = XCBuildConfiguration; 774 | buildSettings = { 775 | APPLICATION_EXTENSION_API_ONLY = YES; 776 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 777 | DEFINES_MODULE = YES; 778 | DYLIB_COMPATIBILITY_VERSION = 1; 779 | DYLIB_CURRENT_VERSION = 1; 780 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 781 | INFOPLIST_FILE = Configs/Annotated.plist; 782 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 783 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 784 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-watchOS"; 785 | PRODUCT_NAME = Annotated; 786 | SDKROOT = watchos; 787 | SKIP_INSTALL = YES; 788 | SWIFT_VERSION = 5.0; 789 | TARGETED_DEVICE_FAMILY = 4; 790 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 791 | }; 792 | name = Debug; 793 | }; 794 | 52D6D9E91BEFFF6E002C0205 /* Release */ = { 795 | isa = XCBuildConfiguration; 796 | buildSettings = { 797 | APPLICATION_EXTENSION_API_ONLY = YES; 798 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 799 | DEFINES_MODULE = YES; 800 | DYLIB_COMPATIBILITY_VERSION = 1; 801 | DYLIB_CURRENT_VERSION = 1; 802 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 803 | INFOPLIST_FILE = Configs/Annotated.plist; 804 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 805 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 806 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-watchOS"; 807 | PRODUCT_NAME = Annotated; 808 | SDKROOT = watchos; 809 | SKIP_INSTALL = YES; 810 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 811 | SWIFT_VERSION = 5.0; 812 | TARGETED_DEVICE_FAMILY = 4; 813 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 814 | }; 815 | name = Release; 816 | }; 817 | 52D6DA021BEFFFBE002C0205 /* Debug */ = { 818 | isa = XCBuildConfiguration; 819 | buildSettings = { 820 | APPLICATION_EXTENSION_API_ONLY = YES; 821 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 822 | DEFINES_MODULE = YES; 823 | DYLIB_COMPATIBILITY_VERSION = 1; 824 | DYLIB_CURRENT_VERSION = 1; 825 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 826 | INFOPLIST_FILE = Configs/Annotated.plist; 827 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 828 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 829 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-tvOS"; 830 | PRODUCT_NAME = Annotated; 831 | SDKROOT = appletvos; 832 | SKIP_INSTALL = YES; 833 | SWIFT_VERSION = 5.0; 834 | TARGETED_DEVICE_FAMILY = 3; 835 | TVOS_DEPLOYMENT_TARGET = 11.0; 836 | }; 837 | name = Debug; 838 | }; 839 | 52D6DA031BEFFFBE002C0205 /* Release */ = { 840 | isa = XCBuildConfiguration; 841 | buildSettings = { 842 | APPLICATION_EXTENSION_API_ONLY = YES; 843 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 844 | DEFINES_MODULE = YES; 845 | DYLIB_COMPATIBILITY_VERSION = 1; 846 | DYLIB_CURRENT_VERSION = 1; 847 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 848 | INFOPLIST_FILE = Configs/Annotated.plist; 849 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 850 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 851 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-tvOS"; 852 | PRODUCT_NAME = Annotated; 853 | SDKROOT = appletvos; 854 | SKIP_INSTALL = YES; 855 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 856 | SWIFT_VERSION = 5.0; 857 | TARGETED_DEVICE_FAMILY = 3; 858 | TVOS_DEPLOYMENT_TARGET = 11.0; 859 | }; 860 | name = Release; 861 | }; 862 | 52D6DA211BF000BD002C0205 /* Debug */ = { 863 | isa = XCBuildConfiguration; 864 | buildSettings = { 865 | APPLICATION_EXTENSION_API_ONLY = YES; 866 | CODE_SIGN_IDENTITY = "-"; 867 | COMBINE_HIDPI_IMAGES = YES; 868 | DEFINES_MODULE = YES; 869 | DYLIB_COMPATIBILITY_VERSION = 1; 870 | DYLIB_CURRENT_VERSION = 1; 871 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 872 | FRAMEWORK_VERSION = A; 873 | INFOPLIST_FILE = Configs/Annotated.plist; 874 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 875 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 876 | MACOSX_DEPLOYMENT_TARGET = 10.10; 877 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-macOS"; 878 | PRODUCT_NAME = Annotated; 879 | SDKROOT = macosx; 880 | SKIP_INSTALL = YES; 881 | SWIFT_VERSION = 5.0; 882 | }; 883 | name = Debug; 884 | }; 885 | 52D6DA221BF000BD002C0205 /* Release */ = { 886 | isa = XCBuildConfiguration; 887 | buildSettings = { 888 | APPLICATION_EXTENSION_API_ONLY = YES; 889 | CODE_SIGN_IDENTITY = "-"; 890 | COMBINE_HIDPI_IMAGES = YES; 891 | DEFINES_MODULE = YES; 892 | DYLIB_COMPATIBILITY_VERSION = 1; 893 | DYLIB_CURRENT_VERSION = 1; 894 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 895 | FRAMEWORK_VERSION = A; 896 | INFOPLIST_FILE = Configs/Annotated.plist; 897 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 898 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 899 | MACOSX_DEPLOYMENT_TARGET = 10.10; 900 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-macOS"; 901 | PRODUCT_NAME = Annotated; 902 | SDKROOT = macosx; 903 | SKIP_INSTALL = YES; 904 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 905 | SWIFT_VERSION = 5.0; 906 | }; 907 | name = Release; 908 | }; 909 | DD7502831C68FCFC006590AF /* Debug */ = { 910 | isa = XCBuildConfiguration; 911 | buildSettings = { 912 | CODE_SIGN_IDENTITY = "-"; 913 | COMBINE_HIDPI_IMAGES = YES; 914 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 915 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 916 | MACOSX_DEPLOYMENT_TARGET = 10.11; 917 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-macOS-Tests"; 918 | PRODUCT_NAME = "$(TARGET_NAME)"; 919 | SDKROOT = macosx; 920 | SWIFT_VERSION = 5.0; 921 | }; 922 | name = Debug; 923 | }; 924 | DD7502841C68FCFC006590AF /* Release */ = { 925 | isa = XCBuildConfiguration; 926 | buildSettings = { 927 | CODE_SIGN_IDENTITY = "-"; 928 | COMBINE_HIDPI_IMAGES = YES; 929 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 930 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 931 | MACOSX_DEPLOYMENT_TARGET = 10.11; 932 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-macOS-Tests"; 933 | PRODUCT_NAME = "$(TARGET_NAME)"; 934 | SDKROOT = macosx; 935 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 936 | SWIFT_VERSION = 5.0; 937 | }; 938 | name = Release; 939 | }; 940 | DD7502961C690C7A006590AF /* Debug */ = { 941 | isa = XCBuildConfiguration; 942 | buildSettings = { 943 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 944 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 945 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-tvOS-Tests"; 946 | PRODUCT_NAME = "$(TARGET_NAME)"; 947 | SDKROOT = appletvos; 948 | SWIFT_VERSION = 5.0; 949 | TVOS_DEPLOYMENT_TARGET = 12.0; 950 | }; 951 | name = Debug; 952 | }; 953 | DD7502971C690C7A006590AF /* Release */ = { 954 | isa = XCBuildConfiguration; 955 | buildSettings = { 956 | INFOPLIST_FILE = Configs/AnnotatedTests.plist; 957 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 958 | PRODUCT_BUNDLE_IDENTIFIER = "com.Annotated.Annotated-tvOS-Tests"; 959 | PRODUCT_NAME = "$(TARGET_NAME)"; 960 | SDKROOT = appletvos; 961 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 962 | SWIFT_VERSION = 5.0; 963 | TVOS_DEPLOYMENT_TARGET = 12.0; 964 | }; 965 | name = Release; 966 | }; 967 | /* End XCBuildConfiguration section */ 968 | 969 | /* Begin XCConfigurationList section */ 970 | 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "Annotated" */ = { 971 | isa = XCConfigurationList; 972 | buildConfigurations = ( 973 | 52D6D98E1BEFF229002C0205 /* Debug */, 974 | 52D6D98F1BEFF229002C0205 /* Release */, 975 | ); 976 | defaultConfigurationIsVisible = 0; 977 | defaultConfigurationName = Release; 978 | }; 979 | 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "Annotated-iOS" */ = { 980 | isa = XCConfigurationList; 981 | buildConfigurations = ( 982 | 52D6D9911BEFF229002C0205 /* Debug */, 983 | 52D6D9921BEFF229002C0205 /* Release */, 984 | ); 985 | defaultConfigurationIsVisible = 0; 986 | defaultConfigurationName = Release; 987 | }; 988 | 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "Annotated-iOS Tests" */ = { 989 | isa = XCConfigurationList; 990 | buildConfigurations = ( 991 | 52D6D9941BEFF229002C0205 /* Debug */, 992 | 52D6D9951BEFF229002C0205 /* Release */, 993 | ); 994 | defaultConfigurationIsVisible = 0; 995 | defaultConfigurationName = Release; 996 | }; 997 | 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "Annotated-watchOS" */ = { 998 | isa = XCConfigurationList; 999 | buildConfigurations = ( 1000 | 52D6D9E81BEFFF6E002C0205 /* Debug */, 1001 | 52D6D9E91BEFFF6E002C0205 /* Release */, 1002 | ); 1003 | defaultConfigurationIsVisible = 0; 1004 | defaultConfigurationName = Release; 1005 | }; 1006 | 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "Annotated-tvOS" */ = { 1007 | isa = XCConfigurationList; 1008 | buildConfigurations = ( 1009 | 52D6DA021BEFFFBE002C0205 /* Debug */, 1010 | 52D6DA031BEFFFBE002C0205 /* Release */, 1011 | ); 1012 | defaultConfigurationIsVisible = 0; 1013 | defaultConfigurationName = Release; 1014 | }; 1015 | 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "Annotated-macOS" */ = { 1016 | isa = XCConfigurationList; 1017 | buildConfigurations = ( 1018 | 52D6DA211BF000BD002C0205 /* Debug */, 1019 | 52D6DA221BF000BD002C0205 /* Release */, 1020 | ); 1021 | defaultConfigurationIsVisible = 0; 1022 | defaultConfigurationName = Release; 1023 | }; 1024 | DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "Annotated-macOS Tests" */ = { 1025 | isa = XCConfigurationList; 1026 | buildConfigurations = ( 1027 | DD7502831C68FCFC006590AF /* Debug */, 1028 | DD7502841C68FCFC006590AF /* Release */, 1029 | ); 1030 | defaultConfigurationIsVisible = 0; 1031 | defaultConfigurationName = Release; 1032 | }; 1033 | DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "Annotated-tvOS Tests" */ = { 1034 | isa = XCConfigurationList; 1035 | buildConfigurations = ( 1036 | DD7502961C690C7A006590AF /* Debug */, 1037 | DD7502971C690C7A006590AF /* Release */, 1038 | ); 1039 | defaultConfigurationIsVisible = 0; 1040 | defaultConfigurationName = Release; 1041 | }; 1042 | /* End XCConfigurationList section */ 1043 | }; 1044 | rootObject = 52D6D9731BEFF229002C0205 /* Project object */; 1045 | } 1046 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/xcshareddata/xcschemes/Annotated-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 64 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/xcshareddata/xcschemes/Annotated-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 64 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/xcshareddata/xcschemes/Annotated-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 64 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Annotated.xcodeproj/xcshareddata/xcschemes/Annotated-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 44 | 45 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jegnux/Annotated/c7e48d6d8292796f69fd7e4b54eae0117976c66c/Assets/screenshot.png -------------------------------------------------------------------------------- /Configs/Annotated.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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2020 Jérôme Alves. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Configs/AnnotatedTests.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 | -------------------------------------------------------------------------------- /Example App/Annotated Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 75630A6325582A200098C6FE /* Annotated_ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A6225582A200098C6FE /* Annotated_ExampleApp.swift */; }; 11 | 75630A6525582A200098C6FE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75630A6425582A200098C6FE /* ContentView.swift */; }; 12 | 75630A6725582A220098C6FE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75630A6625582A220098C6FE /* Assets.xcassets */; }; 13 | 75630A6A25582A220098C6FE /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75630A6925582A220098C6FE /* Preview Assets.xcassets */; }; 14 | 75F9F6B525592B97001ADEF2 /* Annotated.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75F9F68E25592A43001ADEF2 /* Annotated.framework */; }; 15 | 75F9F6B625592B97001ADEF2 /* Annotated.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 75F9F68E25592A43001ADEF2 /* Annotated.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 75F9F6B825592C5D001ADEF2 /* UIKitLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F9F6B725592C5D001ADEF2 /* UIKitLabel.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 75F9F68D25592A43001ADEF2 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 23 | proxyType = 2; 24 | remoteGlobalIDString = 52D6D97C1BEFF229002C0205; 25 | remoteInfo = "Annotated-iOS"; 26 | }; 27 | 75F9F68F25592A43001ADEF2 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 30 | proxyType = 2; 31 | remoteGlobalIDString = 52D6DA0F1BF000BD002C0205; 32 | remoteInfo = "Annotated-macOS"; 33 | }; 34 | 75F9F69125592A43001ADEF2 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = 52D6D9E21BEFFF6E002C0205; 39 | remoteInfo = "Annotated-watchOS"; 40 | }; 41 | 75F9F69325592A43001ADEF2 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 44 | proxyType = 2; 45 | remoteGlobalIDString = 52D6D9F01BEFFFBE002C0205; 46 | remoteInfo = "Annotated-tvOS"; 47 | }; 48 | 75F9F69525592A43001ADEF2 /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 51 | proxyType = 2; 52 | remoteGlobalIDString = 52D6D9861BEFF229002C0205; 53 | remoteInfo = "Annotated-iOS Tests"; 54 | }; 55 | 75F9F69725592A43001ADEF2 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = DD75027A1C68FCFC006590AF; 60 | remoteInfo = "Annotated-macOS Tests"; 61 | }; 62 | 75F9F69925592A43001ADEF2 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 65 | proxyType = 2; 66 | remoteGlobalIDString = DD75028D1C690C7A006590AF; 67 | remoteInfo = "Annotated-tvOS Tests"; 68 | }; 69 | 75F9F69B25592A55001ADEF2 /* PBXContainerItemProxy */ = { 70 | isa = PBXContainerItemProxy; 71 | containerPortal = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 72 | proxyType = 1; 73 | remoteGlobalIDString = 52D6D97B1BEFF229002C0205; 74 | remoteInfo = "Annotated-iOS"; 75 | }; 76 | /* End PBXContainerItemProxy section */ 77 | 78 | /* Begin PBXCopyFilesBuildPhase section */ 79 | 75630A9625582AC40098C6FE /* Embed Frameworks */ = { 80 | isa = PBXCopyFilesBuildPhase; 81 | buildActionMask = 2147483647; 82 | dstPath = ""; 83 | dstSubfolderSpec = 10; 84 | files = ( 85 | 75F9F6B625592B97001ADEF2 /* Annotated.framework in Embed Frameworks */, 86 | ); 87 | name = "Embed Frameworks"; 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXCopyFilesBuildPhase section */ 91 | 92 | /* Begin PBXFileReference section */ 93 | 75630A5F25582A200098C6FE /* Annotated Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Annotated Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 94 | 75630A6225582A200098C6FE /* Annotated_ExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Annotated_ExampleApp.swift; sourceTree = ""; }; 95 | 75630A6425582A200098C6FE /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 96 | 75630A6625582A220098C6FE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97 | 75630A6925582A220098C6FE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 98 | 75630A6B25582A220098C6FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 99 | 75630A7325582A480098C6FE /* Annotated.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Annotated.xcodeproj; path = ../Annotated.xcodeproj; sourceTree = ""; }; 100 | 75F9F6B725592C5D001ADEF2 /* UIKitLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitLabel.swift; sourceTree = ""; }; 101 | /* End PBXFileReference section */ 102 | 103 | /* Begin PBXFrameworksBuildPhase section */ 104 | 75630A5C25582A200098C6FE /* Frameworks */ = { 105 | isa = PBXFrameworksBuildPhase; 106 | buildActionMask = 2147483647; 107 | files = ( 108 | 75F9F6B525592B97001ADEF2 /* Annotated.framework in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | 75630A5625582A200098C6FE = { 116 | isa = PBXGroup; 117 | children = ( 118 | 75630A6125582A200098C6FE /* Annotated Example */, 119 | 75630A7225582A320098C6FE /* Dependencies */, 120 | 75630A6025582A200098C6FE /* Products */, 121 | 75630A9325582AC40098C6FE /* Frameworks */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | 75630A6025582A200098C6FE /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 75630A5F25582A200098C6FE /* Annotated Example.app */, 129 | ); 130 | name = Products; 131 | sourceTree = ""; 132 | }; 133 | 75630A6125582A200098C6FE /* Annotated Example */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 75630A6225582A200098C6FE /* Annotated_ExampleApp.swift */, 137 | 75630A6425582A200098C6FE /* ContentView.swift */, 138 | 75F9F6B725592C5D001ADEF2 /* UIKitLabel.swift */, 139 | 75630A6625582A220098C6FE /* Assets.xcassets */, 140 | 75630A6B25582A220098C6FE /* Info.plist */, 141 | 75630A6825582A220098C6FE /* Preview Content */, 142 | ); 143 | path = "Annotated Example"; 144 | sourceTree = ""; 145 | }; 146 | 75630A6825582A220098C6FE /* Preview Content */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 75630A6925582A220098C6FE /* Preview Assets.xcassets */, 150 | ); 151 | path = "Preview Content"; 152 | sourceTree = ""; 153 | }; 154 | 75630A7225582A320098C6FE /* Dependencies */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 75630A7325582A480098C6FE /* Annotated.xcodeproj */, 158 | ); 159 | name = Dependencies; 160 | sourceTree = ""; 161 | }; 162 | 75630A9325582AC40098C6FE /* Frameworks */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | ); 166 | name = Frameworks; 167 | sourceTree = ""; 168 | }; 169 | 75F9F68425592A43001ADEF2 /* Products */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 75F9F68E25592A43001ADEF2 /* Annotated.framework */, 173 | 75F9F69025592A43001ADEF2 /* Annotated.framework */, 174 | 75F9F69225592A43001ADEF2 /* Annotated.framework */, 175 | 75F9F69425592A43001ADEF2 /* Annotated.framework */, 176 | 75F9F69625592A43001ADEF2 /* Annotated-iOS Tests.xctest */, 177 | 75F9F69825592A43001ADEF2 /* Annotated-macOS Tests.xctest */, 178 | 75F9F69A25592A43001ADEF2 /* Annotated-tvOS Tests.xctest */, 179 | ); 180 | name = Products; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | 75630A5E25582A200098C6FE /* Annotated Example */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 75630A6E25582A220098C6FE /* Build configuration list for PBXNativeTarget "Annotated Example" */; 189 | buildPhases = ( 190 | 75630A5B25582A200098C6FE /* Sources */, 191 | 75630A5C25582A200098C6FE /* Frameworks */, 192 | 75630A5D25582A200098C6FE /* Resources */, 193 | 75630A9625582AC40098C6FE /* Embed Frameworks */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | 75F9F69C25592A55001ADEF2 /* PBXTargetDependency */, 199 | ); 200 | name = "Annotated Example"; 201 | productName = "Annotated Example"; 202 | productReference = 75630A5F25582A200098C6FE /* Annotated Example.app */; 203 | productType = "com.apple.product-type.application"; 204 | }; 205 | /* End PBXNativeTarget section */ 206 | 207 | /* Begin PBXProject section */ 208 | 75630A5725582A200098C6FE /* Project object */ = { 209 | isa = PBXProject; 210 | attributes = { 211 | LastSwiftUpdateCheck = 1220; 212 | LastUpgradeCheck = 1220; 213 | TargetAttributes = { 214 | 75630A5E25582A200098C6FE = { 215 | CreatedOnToolsVersion = 12.2; 216 | }; 217 | }; 218 | }; 219 | buildConfigurationList = 75630A5A25582A200098C6FE /* Build configuration list for PBXProject "Annotated Example" */; 220 | compatibilityVersion = "Xcode 9.3"; 221 | developmentRegion = en; 222 | hasScannedForEncodings = 0; 223 | knownRegions = ( 224 | en, 225 | Base, 226 | ); 227 | mainGroup = 75630A5625582A200098C6FE; 228 | productRefGroup = 75630A6025582A200098C6FE /* Products */; 229 | projectDirPath = ""; 230 | projectReferences = ( 231 | { 232 | ProductGroup = 75F9F68425592A43001ADEF2 /* Products */; 233 | ProjectRef = 75630A7325582A480098C6FE /* Annotated.xcodeproj */; 234 | }, 235 | ); 236 | projectRoot = ""; 237 | targets = ( 238 | 75630A5E25582A200098C6FE /* Annotated Example */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXReferenceProxy section */ 244 | 75F9F68E25592A43001ADEF2 /* Annotated.framework */ = { 245 | isa = PBXReferenceProxy; 246 | fileType = wrapper.framework; 247 | path = Annotated.framework; 248 | remoteRef = 75F9F68D25592A43001ADEF2 /* PBXContainerItemProxy */; 249 | sourceTree = BUILT_PRODUCTS_DIR; 250 | }; 251 | 75F9F69025592A43001ADEF2 /* Annotated.framework */ = { 252 | isa = PBXReferenceProxy; 253 | fileType = wrapper.framework; 254 | path = Annotated.framework; 255 | remoteRef = 75F9F68F25592A43001ADEF2 /* PBXContainerItemProxy */; 256 | sourceTree = BUILT_PRODUCTS_DIR; 257 | }; 258 | 75F9F69225592A43001ADEF2 /* Annotated.framework */ = { 259 | isa = PBXReferenceProxy; 260 | fileType = wrapper.framework; 261 | path = Annotated.framework; 262 | remoteRef = 75F9F69125592A43001ADEF2 /* PBXContainerItemProxy */; 263 | sourceTree = BUILT_PRODUCTS_DIR; 264 | }; 265 | 75F9F69425592A43001ADEF2 /* Annotated.framework */ = { 266 | isa = PBXReferenceProxy; 267 | fileType = wrapper.framework; 268 | path = Annotated.framework; 269 | remoteRef = 75F9F69325592A43001ADEF2 /* PBXContainerItemProxy */; 270 | sourceTree = BUILT_PRODUCTS_DIR; 271 | }; 272 | 75F9F69625592A43001ADEF2 /* Annotated-iOS Tests.xctest */ = { 273 | isa = PBXReferenceProxy; 274 | fileType = wrapper.cfbundle; 275 | path = "Annotated-iOS Tests.xctest"; 276 | remoteRef = 75F9F69525592A43001ADEF2 /* PBXContainerItemProxy */; 277 | sourceTree = BUILT_PRODUCTS_DIR; 278 | }; 279 | 75F9F69825592A43001ADEF2 /* Annotated-macOS Tests.xctest */ = { 280 | isa = PBXReferenceProxy; 281 | fileType = wrapper.cfbundle; 282 | path = "Annotated-macOS Tests.xctest"; 283 | remoteRef = 75F9F69725592A43001ADEF2 /* PBXContainerItemProxy */; 284 | sourceTree = BUILT_PRODUCTS_DIR; 285 | }; 286 | 75F9F69A25592A43001ADEF2 /* Annotated-tvOS Tests.xctest */ = { 287 | isa = PBXReferenceProxy; 288 | fileType = wrapper.cfbundle; 289 | path = "Annotated-tvOS Tests.xctest"; 290 | remoteRef = 75F9F69925592A43001ADEF2 /* PBXContainerItemProxy */; 291 | sourceTree = BUILT_PRODUCTS_DIR; 292 | }; 293 | /* End PBXReferenceProxy section */ 294 | 295 | /* Begin PBXResourcesBuildPhase section */ 296 | 75630A5D25582A200098C6FE /* Resources */ = { 297 | isa = PBXResourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 75630A6A25582A220098C6FE /* Preview Assets.xcassets in Resources */, 301 | 75630A6725582A220098C6FE /* Assets.xcassets in Resources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXResourcesBuildPhase section */ 306 | 307 | /* Begin PBXSourcesBuildPhase section */ 308 | 75630A5B25582A200098C6FE /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 75F9F6B825592C5D001ADEF2 /* UIKitLabel.swift in Sources */, 313 | 75630A6525582A200098C6FE /* ContentView.swift in Sources */, 314 | 75630A6325582A200098C6FE /* Annotated_ExampleApp.swift in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | /* End PBXSourcesBuildPhase section */ 319 | 320 | /* Begin PBXTargetDependency section */ 321 | 75F9F69C25592A55001ADEF2 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | name = "Annotated-iOS"; 324 | targetProxy = 75F9F69B25592A55001ADEF2 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin XCBuildConfiguration section */ 329 | 75630A6C25582A220098C6FE /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_ANALYZER_NONNULL = YES; 334 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_ENABLE_OBJC_WEAK = YES; 340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_COMMA = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu11; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 381 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 382 | MTL_FAST_MATH = YES; 383 | ONLY_ACTIVE_ARCH = YES; 384 | SDKROOT = iphoneos; 385 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 386 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 387 | }; 388 | name = Debug; 389 | }; 390 | 75630A6D25582A220098C6FE /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_ANALYZER_NONNULL = YES; 395 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_ENABLE_OBJC_WEAK = YES; 401 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 402 | CLANG_WARN_BOOL_CONVERSION = YES; 403 | CLANG_WARN_COMMA = YES; 404 | CLANG_WARN_CONSTANT_CONVERSION = YES; 405 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 407 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 408 | CLANG_WARN_EMPTY_BODY = YES; 409 | CLANG_WARN_ENUM_CONVERSION = YES; 410 | CLANG_WARN_INFINITE_RECURSION = YES; 411 | CLANG_WARN_INT_CONVERSION = YES; 412 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 414 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 415 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 416 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 417 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 418 | CLANG_WARN_STRICT_PROTOTYPES = YES; 419 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 420 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 421 | CLANG_WARN_UNREACHABLE_CODE = YES; 422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 423 | COPY_PHASE_STRIP = NO; 424 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 425 | ENABLE_NS_ASSERTIONS = NO; 426 | ENABLE_STRICT_OBJC_MSGSEND = YES; 427 | GCC_C_LANGUAGE_STANDARD = gnu11; 428 | GCC_NO_COMMON_BLOCKS = YES; 429 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 430 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 431 | GCC_WARN_UNDECLARED_SELECTOR = YES; 432 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 433 | GCC_WARN_UNUSED_FUNCTION = YES; 434 | GCC_WARN_UNUSED_VARIABLE = YES; 435 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 436 | MTL_ENABLE_DEBUG_INFO = NO; 437 | MTL_FAST_MATH = YES; 438 | SDKROOT = iphoneos; 439 | SWIFT_COMPILATION_MODE = wholemodule; 440 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 441 | VALIDATE_PRODUCT = YES; 442 | }; 443 | name = Release; 444 | }; 445 | 75630A6F25582A220098C6FE /* Debug */ = { 446 | isa = XCBuildConfiguration; 447 | buildSettings = { 448 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 449 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 450 | CODE_SIGN_STYLE = Automatic; 451 | DEVELOPMENT_ASSET_PATHS = "\"Annotated Example/Preview Content\""; 452 | DEVELOPMENT_TEAM = 7S3JK3C955; 453 | ENABLE_PREVIEWS = YES; 454 | INFOPLIST_FILE = "Annotated Example/Info.plist"; 455 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 456 | LD_RUNPATH_SEARCH_PATHS = ( 457 | "$(inherited)", 458 | "@executable_path/Frameworks", 459 | ); 460 | PRODUCT_BUNDLE_IDENTIFIER = "com.jeromealves.Annotated-Example"; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | SWIFT_VERSION = 5.0; 463 | TARGETED_DEVICE_FAMILY = "1,2"; 464 | }; 465 | name = Debug; 466 | }; 467 | 75630A7025582A220098C6FE /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 472 | CODE_SIGN_STYLE = Automatic; 473 | DEVELOPMENT_ASSET_PATHS = "\"Annotated Example/Preview Content\""; 474 | DEVELOPMENT_TEAM = 7S3JK3C955; 475 | ENABLE_PREVIEWS = YES; 476 | INFOPLIST_FILE = "Annotated Example/Info.plist"; 477 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 478 | LD_RUNPATH_SEARCH_PATHS = ( 479 | "$(inherited)", 480 | "@executable_path/Frameworks", 481 | ); 482 | PRODUCT_BUNDLE_IDENTIFIER = "com.jeromealves.Annotated-Example"; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | SWIFT_VERSION = 5.0; 485 | TARGETED_DEVICE_FAMILY = "1,2"; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | 75630A5A25582A200098C6FE /* Build configuration list for PBXProject "Annotated Example" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 75630A6C25582A220098C6FE /* Debug */, 496 | 75630A6D25582A220098C6FE /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | 75630A6E25582A220098C6FE /* Build configuration list for PBXNativeTarget "Annotated Example" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 75630A6F25582A220098C6FE /* Debug */, 505 | 75630A7025582A220098C6FE /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | /* End XCConfigurationList section */ 511 | }; 512 | rootObject = 75630A5725582A200098C6FE /* Project object */; 513 | } 514 | -------------------------------------------------------------------------------- /Example App/Annotated Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example App/Annotated Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Annotated_ExampleApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Annotated_ExampleApp.swift 3 | // Annotated Example 4 | // 5 | // Created by Jérôme Alves on 08/11/2020. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct Annotated_ExampleApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example App/Annotated Example/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Annotated Example 4 | // 5 | // Created by Jérôme Alves on 08/11/2020. 6 | // 7 | 8 | import SwiftUI 9 | import Annotated 10 | 11 | enum AddressAnnotations: Hashable { 12 | case city, postalCode, highlighted 13 | } 14 | 15 | struct ContentView: View { 16 | 17 | let string: Annotated = { 18 | var string: Annotated = """ 19 | 1 Infinite Loop 20 | \("Cupertino", .city), CA \(95014, .postalCode) 21 | """ 22 | 23 | string.addAnnotation(.highlighted, at: 0..<1) 24 | string.addAnnotation(.highlighted, forOccurencesOf: "in", options: .caseInsensitive) 25 | 26 | return string 27 | }() 28 | 29 | var body: some View { 30 | VStack(alignment: .leading) { 31 | Spacer() 32 | Text("UIKit.UILabel + NSAttributedString").font(.caption) 33 | UIKitLabel(attributedText: attributedText) 34 | .padding() 35 | .border(Color.red) 36 | Spacer() 37 | Text("SwiftUI.Text").font(.caption) 38 | text 39 | .padding() 40 | .border(Color.red) 41 | Spacer() 42 | } 43 | .padding() 44 | } 45 | 46 | var attributedText: NSAttributedString { 47 | string.makeAttributedString { annotation in 48 | switch annotation { 49 | case nil: return [.font: UIFont.systemFont(ofSize: 24)] 50 | case .city: return [.font: UIFont.boldSystemFont(ofSize: 24)] 51 | case .postalCode: return [.underlineStyle: NSNumber(value: NSUnderlineStyle.single.rawValue)] 52 | case .highlighted: return [.foregroundColor: UIColor.systemRed] 53 | } 54 | } 55 | } 56 | 57 | var text: Text { 58 | string.makeText { annotation in 59 | switch annotation { 60 | case nil: return { $0.font(.system(size: 24)) } 61 | case .city: return { $0.bold() } 62 | case .postalCode: return { $0.underline() } 63 | case .highlighted: return { $0.foregroundColor(.red) } 64 | } 65 | } 66 | } 67 | } 68 | 69 | struct ContentView_Previews: PreviewProvider { 70 | static var previews: some View { 71 | ContentView() 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | 28 | UIApplicationSupportsIndirectInputEvents 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Example App/Annotated Example/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example App/Annotated Example/UIKitLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIKitLabel.swift 3 | // Annotated Example 4 | // 5 | // Created by Jérôme Alves on 09/11/2020. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | import SwiftUI 11 | 12 | struct UIKitLabel: UIViewRepresentable { 13 | 14 | var attributedText: NSAttributedString 15 | 16 | func makeUIView(context: Context) -> UILabel { 17 | let label = UILabel() 18 | label.numberOfLines = 0 19 | label.setContentHuggingPriority(.required, for: .vertical) 20 | label.setContentHuggingPriority(.required, for: .horizontal) 21 | return label 22 | } 23 | 24 | func updateUIView(_ label: UILabel, context: Context) { 25 | label.attributedText = attributedText 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jérôme Alves 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 | // swift-tools-version:4.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Annotated", 8 | products: [ 9 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 10 | .library( 11 | name: "Annotated", 12 | targets: ["Annotated"]), 13 | ], 14 | dependencies: [ 15 | // Dependencies declare other packages that this package depends on. 16 | // .package(url: /* package url */, from: "1.0.0"), 17 | ], 18 | targets: [ 19 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 20 | // Targets can depend on other targets in this package, and on products in packages which this package depends on. 21 | .target( 22 | name: "Annotated", 23 | dependencies: []), 24 | .testTarget( 25 | name: "AnnotatedTests", 26 | dependencies: ["Annotated"]), 27 | ] 28 | ) 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Annotated 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/Annotated.svg?style=flat)](https://cocoapods.org/pods/Annotated) 4 | [![License](https://img.shields.io/cocoapods/l/Annotated.svg?style=flat)](https://cocoapods.org/pods/Annotated) 5 | [![Platform](https://img.shields.io/cocoapods/p/Annotated.svg?style=flat)](https://cocoapods.org/pods/Annotated) 6 | 7 | *Annotated* is a small library that let you annotate your strings with semantic annotations. 8 | Once a `String` is annotated, you can transform it to a `NSAttributedString` or a SwiftUI `Text` 9 | 10 | It allows you, for example, to semantically annotate a `String` in your _View Model_ without thinking about the final visual style, and then render your `String` in your _View_ as an `NSAttributedString`. 11 | 12 | ## Requirements 13 | 14 | - iOS 11.0 15 | - Swift 5.1 16 | 17 | ## Installation 18 | *Annotated* is available through CocoaPods and SwiftPM 19 | 20 | ## Example 21 | 22 | First, you need to define your annotations. Using an `enum` is generally great for that. 23 | ```swift 24 | enum AddressAnnotations: Hashable { 25 | case city, postalCode, highlighted 26 | } 27 | ``` 28 | 29 | Then you can create you `Annotated` string using a string literal. You can directly annotate parts of your string thanks to custom String Interpolation. 30 | ```swift 31 | var string: Annotated = """ 32 | 1 Infinite Loop 33 | \("Cupertino", .city), CA \(95014, .postalCode) 34 | """ 35 | ``` 36 | 37 | You can also add annotations manually. 38 | ```swift 39 | string.addAnnotation(.highlighted, at: 0..<1) 40 | string.addAnnotation(.highlighted, forOccurencesOf: "in", options: .caseInsensitive) 41 | ``` 42 | 43 | Finally, you can render your string into an `NSAttributedString` or a SwiftUI `Text` using provided factory methods. 44 | 45 | ```swift 46 | let attributedString = string.makeAttributedString { annotation in 47 | switch annotation { 48 | case nil: return [.font: UIFont.systemFont(ofSize: 24)] 49 | case .city: return [.font: UIFont.boldSystemFont(ofSize: 24)] 50 | case .postalCode: return [.underlineStyle: NSNumber(value: NSUnderlineStyle.single.rawValue)] 51 | case .highlighted: return [.foregroundColor: UIColor.systemRed] 52 | } 53 | } 54 | ``` 55 | ```swift 56 | let text = string.makeText { annotation in 57 | switch annotation { 58 | case nil: return { $0.font(.system(size: 24)) } 59 | case .city: return { $0.bold() } 60 | case .postalCode: return { $0.underline() } 61 | case .highlighted: return { $0.foregroundColor(.red) } 62 | } 63 | } 64 | ``` 65 | 66 | 67 | 68 | ## Author 69 | 70 | [Jérôme Alves](https://twitter.com/jegnux) 71 | 72 | ## License 73 | 74 | **Annotated** is available under the MIT license. See the [LICENSE](LICENSE) file for more info. 75 | -------------------------------------------------------------------------------- /Sources/Annotated+Annotation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Annotated+Annotation.swift 3 | // Annotated 4 | // 5 | // Created by Jérôme Alves on 08/11/2020. 6 | // Copyright © 2020 Annotated. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Annotated { 12 | public struct Annotation: CustomStringConvertible { 13 | public init(substring: Substring, range: Range, annotation: T?) { 14 | self.substring = substring 15 | self.range = range 16 | self.annotation = annotation 17 | } 18 | 19 | public let substring: Substring 20 | public let range: Range 21 | public let annotation: T? 22 | 23 | private var base: String { 24 | substring.base 25 | } 26 | 27 | private var intRange: Range { 28 | base.distance(from: base.startIndex, to: range.lowerBound) ..< base.distance(from: base.startIndex, to: range.upperBound) 29 | } 30 | 31 | public var description: String { 32 | "\(intRange) → \"\(substring)\" → \(annotation.map(String.init(describing:)) ?? "nil")" 33 | } 34 | } 35 | 36 | public var annotations: AnySequence { 37 | AnySequence( 38 | rawAnnotations.lazy.map { range, annotation in 39 | Annotation(substring: rawValue[range], range: range, annotation: annotation) 40 | } 41 | ) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/Annotated+NSAttributedString.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Annotated+NSAttributedString.swift 3 | // Annotated 4 | // 5 | // Created by Jérôme Alves on 08/11/2020. 6 | // Copyright © 2020 Annotated. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Annotated { 12 | public func makeAttributedString(_ map: (T?) -> [NSAttributedString.Key: Any]) -> NSAttributedString { 13 | let attributedString = NSMutableAttributedString(string: rawValue) 14 | let mapping = Dictionary(uniqueKeysWithValues: Set([nil] + rawAnnotations.map(\.1)).compactMap { ($0, map($0)) }) 15 | 16 | if let attributes = mapping[nil] { 17 | let range = NSRange(rawValue.startIndex.., T)] = [] 15 | } 16 | } 17 | 18 | extension Annotated.StringInterpolation: StringInterpolationProtocol { 19 | public init(literalCapacity: Int, interpolationCount: Int) { 20 | rawValue.reserveCapacity(literalCapacity) 21 | } 22 | 23 | public mutating func appendLiteral(_ literal: String) { 24 | rawValue.append(literal) 25 | } 26 | 27 | public mutating func appendInterpolation(_ interpolation: Annotated, _ annotation: T) { 28 | let start = rawValue.endIndex 29 | let offset = rawValue.distance(from: rawValue.startIndex, to: rawValue.endIndex) 30 | rawValue.append(interpolation.rawValue) 31 | rawAnnotations.append(contentsOf: interpolation.rawAnnotations.map { range, annotation in 32 | let lowerBound = rawValue.index(range.lowerBound, offsetBy: offset) 33 | let upperBound = rawValue.index(range.upperBound, offsetBy: offset) 34 | return (lowerBound.. (Text) -> Text) -> Text { 17 | var text = Text("") 18 | for (range, annotations) in flattenedAnnotations { 19 | var subtext = factory(nil)(Text(rawValue[range])) 20 | for annotation in annotations { 21 | subtext = factory(annotation)(subtext) 22 | } 23 | text = text + subtext 24 | } 25 | return text 26 | } 27 | 28 | private var flattenedAnnotations: [(Range, [T])] { 29 | 30 | var stack: [String.Index: [T]] = [:] 31 | 32 | for (range, annotation) in rawAnnotations { 33 | var start = range.lowerBound 34 | repeat { 35 | stack[start, default:[]].append(annotation) 36 | start = rawValue.index(after: start) 37 | } while start < range.upperBound 38 | } 39 | 40 | var result: [(Range, [T])] = [] 41 | 42 | var start = rawValue.startIndex 43 | for i in rawValue.indices where i != start { 44 | if stack[i] == stack[start] { 45 | continue 46 | } else { 47 | result.append((start.. { 13 | 14 | private(set) public var rawValue: String 15 | private(set) public var rawAnnotations: [(Range, T)] = [] 16 | 17 | public subscript(dynamicMember keyPath: KeyPath) -> T { 18 | rawValue[keyPath: keyPath] 19 | } 20 | 21 | public mutating func addAnnotation(_ annotation: T, at range: Range) { 22 | let range = rawValue.index(rawValue.startIndex, offsetBy: range.lowerBound) ..< rawValue.index(rawValue.startIndex, offsetBy: range.upperBound) 23 | rawAnnotations.append((range, annotation)) 24 | } 25 | 26 | public mutating func addAnnotation(_ annotation: T, at range: Range) { 27 | rawAnnotations.append((range, annotation)) 28 | } 29 | 30 | public mutating func addAnnotation(_ annotation: T, forOccurencesOf substring: S, options: String.CompareOptions = []) { 31 | var start = rawValue.startIndex 32 | while let range = rawValue[start...].range(of: substring, options: options.subtracting(.backwards)) { 33 | start = range.upperBound 34 | addAnnotation(annotation, at: range) 35 | } 36 | } 37 | } 38 | 39 | extension Annotated: ExpressibleByStringInterpolation { 40 | 41 | public init(stringLiteral value: String) { 42 | rawValue = value 43 | } 44 | 45 | public init(stringInterpolation: StringInterpolation) { 46 | rawValue = stringInterpolation.rawValue 47 | rawAnnotations = stringInterpolation.rawAnnotations 48 | } 49 | 50 | } 51 | 52 | extension Annotated: CustomStringConvertible { 53 | public var description: String { 54 | let annotationsDescription = annotations 55 | .map { " \($0)," } 56 | .joined(separator: "\n") 57 | 58 | return """ 59 | Annotated( 60 | rawValue: \""" 61 | \(rawValue.split(separator: "\n").map { " " + $0 }.joined(separator: "\n")) 62 | \""", 63 | annotations: [ 64 | \(annotationsDescription) 65 | ]) 66 | """ 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Sources/String+.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+.swift 3 | // Annotated 4 | // 5 | // Created by Jérôme Alves on 09/11/2020. 6 | // Copyright © 2020 Annotated. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension String { 12 | internal func intRange(for range: Range) -> Range { 13 | distance(from: startIndex, to: range.lowerBound) ..< distance(from: startIndex, to: range.upperBound) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Tests/AnnotatedTests/AnnotatedTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnnotatedTests.swift 3 | // Annotated 4 | // 5 | // Created by Jérôme Alves on 08/11/2020. 6 | // Copyright © 2020 Annotated. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import XCTest 11 | import Annotated 12 | 13 | class AnnotatedTests: XCTestCase { 14 | func testExample() { 15 | 16 | } 17 | 18 | static var allTests = [ 19 | ("testExample", testExample), 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import AnnotatedTests 3 | 4 | XCTMain([ 5 | testCase(AnnotatedTests.allTests), 6 | ]) 7 | --------------------------------------------------------------------------------