├── .gitignore ├── Assets ├── Assets.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Assets │ ├── AppDelegate.swift │ ├── AssetCellView.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_128@2x.png │ │ │ ├── app_icon_128w@1x.png │ │ │ ├── app_icon_16@1x.png │ │ │ ├── app_icon_16@2x.png │ │ │ ├── app_icon_256@1x.png │ │ │ ├── app_icon_256@2x.png │ │ │ ├── app_icon_32@1x.png │ │ │ ├── app_icon_32@2x.png │ │ │ ├── app_icon_512@1x.png │ │ │ └── app_icon_512@2x.png │ │ ├── Contents.json │ │ ├── Designer Folder icon_21.imageset │ │ │ ├── Contents.json │ │ │ ├── Designer Folder icon_21.png │ │ │ ├── Designer Folder icon_21@2x.png │ │ │ └── Designer Folder icon_21@3x.png │ │ └── Project Folder Icon_21.imageset │ │ │ ├── Contents.json │ │ │ ├── Project Folder Icon_21.png │ │ │ ├── Project Folder Icon_21@2x.png │ │ │ └── Project Folder Icon_21@3x.png │ ├── AssetsPair.swift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Document.swift │ ├── ImageFile.swift │ ├── Info.plist │ └── ViewController.swift ├── AssetsTests │ ├── AssetsTests.swift │ └── Info.plist └── AssetsUITests │ ├── AssetsUITests.swift │ └── Info.plist ├── Assets_icon.sketch ├── LICENSE ├── README.md ├── Screenshots └── Assets-01.png └── document_icon_512@2x.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /Assets/Assets.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 89780CF71D5E3B1400FD95C0 /* AssetsPair.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89780CF61D5E3B1400FD95C0 /* AssetsPair.swift */; }; 11 | 89780CF91D5E622300FD95C0 /* ImageFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89780CF81D5E622300FD95C0 /* ImageFile.swift */; }; 12 | 89B8ACD61D55A68D001D4144 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89B8ACD51D55A68D001D4144 /* AppDelegate.swift */; }; 13 | 89B8ACD81D55A68D001D4144 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89B8ACD71D55A68D001D4144 /* ViewController.swift */; }; 14 | 89B8ACDA1D55A68D001D4144 /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89B8ACD91D55A68D001D4144 /* Document.swift */; }; 15 | 89B8ACDC1D55A68D001D4144 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 89B8ACDB1D55A68D001D4144 /* Assets.xcassets */; }; 16 | 89B8ACDF1D55A68D001D4144 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 89B8ACDD1D55A68D001D4144 /* Main.storyboard */; }; 17 | 89B8ACEA1D55A68D001D4144 /* AssetsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89B8ACE91D55A68D001D4144 /* AssetsTests.swift */; }; 18 | 89B8ACF51D55A68D001D4144 /* AssetsUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89B8ACF41D55A68D001D4144 /* AssetsUITests.swift */; }; 19 | 89C5F8151D58433E00C3FBC1 /* AssetCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89C5F8141D58433E00C3FBC1 /* AssetCellView.swift */; }; 20 | 89FA36541D68C16C00F0CCCC /* document_icon_512@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 89FA36531D68C16C00F0CCCC /* document_icon_512@2x.png */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 89B8ACE61D55A68D001D4144 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 89B8ACCA1D55A68D001D4144 /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 89B8ACD11D55A68D001D4144; 29 | remoteInfo = Assets; 30 | }; 31 | 89B8ACF11D55A68D001D4144 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 89B8ACCA1D55A68D001D4144 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 89B8ACD11D55A68D001D4144; 36 | remoteInfo = Assets; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 89780CF61D5E3B1400FD95C0 /* AssetsPair.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssetsPair.swift; sourceTree = ""; }; 42 | 89780CF81D5E622300FD95C0 /* ImageFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageFile.swift; sourceTree = ""; }; 43 | 89B8ACD21D55A68D001D4144 /* Assets.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Assets.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 89B8ACD51D55A68D001D4144 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45 | 89B8ACD71D55A68D001D4144 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 46 | 89B8ACD91D55A68D001D4144 /* Document.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = ""; }; 47 | 89B8ACDB1D55A68D001D4144 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 89B8ACDE1D55A68D001D4144 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 89B8ACE01D55A68D001D4144 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 89B8ACE51D55A68D001D4144 /* AssetsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AssetsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 89B8ACE91D55A68D001D4144 /* AssetsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetsTests.swift; sourceTree = ""; }; 52 | 89B8ACEB1D55A68D001D4144 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 89B8ACF01D55A68D001D4144 /* AssetsUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AssetsUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 89B8ACF41D55A68D001D4144 /* AssetsUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetsUITests.swift; sourceTree = ""; }; 55 | 89B8ACF61D55A68D001D4144 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 89C5F8141D58433E00C3FBC1 /* AssetCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssetCellView.swift; sourceTree = ""; }; 57 | 89FA36531D68C16C00F0CCCC /* document_icon_512@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "document_icon_512@2x.png"; path = "../../document_icon_512@2x.png"; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 89B8ACCF1D55A68D001D4144 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 89B8ACE21D55A68D001D4144 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 89B8ACED1D55A68D001D4144 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 89B8ACC91D55A68D001D4144 = { 86 | isa = PBXGroup; 87 | children = ( 88 | 89B8ACD41D55A68D001D4144 /* Assets */, 89 | 89B8ACE81D55A68D001D4144 /* AssetsTests */, 90 | 89B8ACF31D55A68D001D4144 /* AssetsUITests */, 91 | 89B8ACD31D55A68D001D4144 /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 89B8ACD31D55A68D001D4144 /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 89B8ACD21D55A68D001D4144 /* Assets.app */, 99 | 89B8ACE51D55A68D001D4144 /* AssetsTests.xctest */, 100 | 89B8ACF01D55A68D001D4144 /* AssetsUITests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 89B8ACD41D55A68D001D4144 /* Assets */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 89B8ACD51D55A68D001D4144 /* AppDelegate.swift */, 109 | 89C5F8141D58433E00C3FBC1 /* AssetCellView.swift */, 110 | 89B8ACD71D55A68D001D4144 /* ViewController.swift */, 111 | 89B8ACD91D55A68D001D4144 /* Document.swift */, 112 | 89780CF61D5E3B1400FD95C0 /* AssetsPair.swift */, 113 | 89780CF81D5E622300FD95C0 /* ImageFile.swift */, 114 | 89B8ACDB1D55A68D001D4144 /* Assets.xcassets */, 115 | 89FA36531D68C16C00F0CCCC /* document_icon_512@2x.png */, 116 | 89B8ACDD1D55A68D001D4144 /* Main.storyboard */, 117 | 89B8ACE01D55A68D001D4144 /* Info.plist */, 118 | ); 119 | path = Assets; 120 | sourceTree = ""; 121 | }; 122 | 89B8ACE81D55A68D001D4144 /* AssetsTests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 89B8ACE91D55A68D001D4144 /* AssetsTests.swift */, 126 | 89B8ACEB1D55A68D001D4144 /* Info.plist */, 127 | ); 128 | path = AssetsTests; 129 | sourceTree = ""; 130 | }; 131 | 89B8ACF31D55A68D001D4144 /* AssetsUITests */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 89B8ACF41D55A68D001D4144 /* AssetsUITests.swift */, 135 | 89B8ACF61D55A68D001D4144 /* Info.plist */, 136 | ); 137 | path = AssetsUITests; 138 | sourceTree = ""; 139 | }; 140 | /* End PBXGroup section */ 141 | 142 | /* Begin PBXNativeTarget section */ 143 | 89B8ACD11D55A68D001D4144 /* Assets */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = 89B8ACF91D55A68D001D4144 /* Build configuration list for PBXNativeTarget "Assets" */; 146 | buildPhases = ( 147 | 89B8ACCE1D55A68D001D4144 /* Sources */, 148 | 89B8ACCF1D55A68D001D4144 /* Frameworks */, 149 | 89B8ACD01D55A68D001D4144 /* Resources */, 150 | 89780CFA1D5EFD2400FD95C0 /* Additional Warnings */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = Assets; 157 | productName = Assets; 158 | productReference = 89B8ACD21D55A68D001D4144 /* Assets.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | 89B8ACE41D55A68D001D4144 /* AssetsTests */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = 89B8ACFC1D55A68D001D4144 /* Build configuration list for PBXNativeTarget "AssetsTests" */; 164 | buildPhases = ( 165 | 89B8ACE11D55A68D001D4144 /* Sources */, 166 | 89B8ACE21D55A68D001D4144 /* Frameworks */, 167 | 89B8ACE31D55A68D001D4144 /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | 89B8ACE71D55A68D001D4144 /* PBXTargetDependency */, 173 | ); 174 | name = AssetsTests; 175 | productName = AssetsTests; 176 | productReference = 89B8ACE51D55A68D001D4144 /* AssetsTests.xctest */; 177 | productType = "com.apple.product-type.bundle.unit-test"; 178 | }; 179 | 89B8ACEF1D55A68D001D4144 /* AssetsUITests */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = 89B8ACFF1D55A68D001D4144 /* Build configuration list for PBXNativeTarget "AssetsUITests" */; 182 | buildPhases = ( 183 | 89B8ACEC1D55A68D001D4144 /* Sources */, 184 | 89B8ACED1D55A68D001D4144 /* Frameworks */, 185 | 89B8ACEE1D55A68D001D4144 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | 89B8ACF21D55A68D001D4144 /* PBXTargetDependency */, 191 | ); 192 | name = AssetsUITests; 193 | productName = AssetsUITests; 194 | productReference = 89B8ACF01D55A68D001D4144 /* AssetsUITests.xctest */; 195 | productType = "com.apple.product-type.bundle.ui-testing"; 196 | }; 197 | /* End PBXNativeTarget section */ 198 | 199 | /* Begin PBXProject section */ 200 | 89B8ACCA1D55A68D001D4144 /* Project object */ = { 201 | isa = PBXProject; 202 | attributes = { 203 | LastSwiftUpdateCheck = 0730; 204 | LastUpgradeCheck = 0800; 205 | ORGANIZATIONNAME = "Arnaud Thiercelin"; 206 | TargetAttributes = { 207 | 89B8ACD11D55A68D001D4144 = { 208 | CreatedOnToolsVersion = 7.3.1; 209 | LastSwiftMigration = 0800; 210 | }; 211 | 89B8ACE41D55A68D001D4144 = { 212 | CreatedOnToolsVersion = 7.3.1; 213 | LastSwiftMigration = 0800; 214 | TestTargetID = 89B8ACD11D55A68D001D4144; 215 | }; 216 | 89B8ACEF1D55A68D001D4144 = { 217 | CreatedOnToolsVersion = 7.3.1; 218 | LastSwiftMigration = 0800; 219 | TestTargetID = 89B8ACD11D55A68D001D4144; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 89B8ACCD1D55A68D001D4144 /* Build configuration list for PBXProject "Assets" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = 89B8ACC91D55A68D001D4144; 232 | productRefGroup = 89B8ACD31D55A68D001D4144 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 89B8ACD11D55A68D001D4144 /* Assets */, 237 | 89B8ACE41D55A68D001D4144 /* AssetsTests */, 238 | 89B8ACEF1D55A68D001D4144 /* AssetsUITests */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXResourcesBuildPhase section */ 244 | 89B8ACD01D55A68D001D4144 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 89B8ACDC1D55A68D001D4144 /* Assets.xcassets in Resources */, 249 | 89B8ACDF1D55A68D001D4144 /* Main.storyboard in Resources */, 250 | 89FA36541D68C16C00F0CCCC /* document_icon_512@2x.png in Resources */, 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 89B8ACE31D55A68D001D4144 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | 89B8ACEE1D55A68D001D4144 /* Resources */ = { 262 | isa = PBXResourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXShellScriptBuildPhase section */ 271 | 89780CFA1D5EFD2400FD95C0 /* Additional Warnings */ = { 272 | isa = PBXShellScriptBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | inputPaths = ( 277 | ); 278 | name = "Additional Warnings"; 279 | outputPaths = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | shellPath = /bin/sh; 283 | shellScript = "KEYWORDS=\"TODO:|FIXME:|\\?\\?\\?:|\\!\\!\\!:\"\nfind \"${SRCROOT}\" \\( -name \"*.h\" -or -name \"*.m\" -or -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($KEYWORDS).*\\$\" | perl -p -e \"s/($KEYWORDS)/ warning: \\$1/\"\n"; 284 | }; 285 | /* End PBXShellScriptBuildPhase section */ 286 | 287 | /* Begin PBXSourcesBuildPhase section */ 288 | 89B8ACCE1D55A68D001D4144 /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 89B8ACD81D55A68D001D4144 /* ViewController.swift in Sources */, 293 | 89C5F8151D58433E00C3FBC1 /* AssetCellView.swift in Sources */, 294 | 89B8ACD61D55A68D001D4144 /* AppDelegate.swift in Sources */, 295 | 89780CF91D5E622300FD95C0 /* ImageFile.swift in Sources */, 296 | 89780CF71D5E3B1400FD95C0 /* AssetsPair.swift in Sources */, 297 | 89B8ACDA1D55A68D001D4144 /* Document.swift in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | 89B8ACE11D55A68D001D4144 /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | 89B8ACEA1D55A68D001D4144 /* AssetsTests.swift in Sources */, 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | 89B8ACEC1D55A68D001D4144 /* Sources */ = { 310 | isa = PBXSourcesBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | 89B8ACF51D55A68D001D4144 /* AssetsUITests.swift in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXSourcesBuildPhase section */ 318 | 319 | /* Begin PBXTargetDependency section */ 320 | 89B8ACE71D55A68D001D4144 /* PBXTargetDependency */ = { 321 | isa = PBXTargetDependency; 322 | target = 89B8ACD11D55A68D001D4144 /* Assets */; 323 | targetProxy = 89B8ACE61D55A68D001D4144 /* PBXContainerItemProxy */; 324 | }; 325 | 89B8ACF21D55A68D001D4144 /* PBXTargetDependency */ = { 326 | isa = PBXTargetDependency; 327 | target = 89B8ACD11D55A68D001D4144 /* Assets */; 328 | targetProxy = 89B8ACF11D55A68D001D4144 /* PBXContainerItemProxy */; 329 | }; 330 | /* End PBXTargetDependency section */ 331 | 332 | /* Begin PBXVariantGroup section */ 333 | 89B8ACDD1D55A68D001D4144 /* Main.storyboard */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | 89B8ACDE1D55A68D001D4144 /* Base */, 337 | ); 338 | name = Main.storyboard; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 89B8ACF71D55A68D001D4144 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | CLANG_ANALYZER_NONNULL = YES; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INFINITE_RECURSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | CODE_SIGN_IDENTITY = "-"; 365 | COPY_PHASE_STRIP = NO; 366 | DEBUG_INFORMATION_FORMAT = dwarf; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | ENABLE_TESTABILITY = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_OPTIMIZATION_LEVEL = 0; 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | MACOSX_DEPLOYMENT_TARGET = 10.12; 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | SDKROOT = macosx; 387 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 388 | }; 389 | name = Debug; 390 | }; 391 | 89B8ACF81D55A68D001D4144 /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_NONNULL = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BOOL_CONVERSION = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | CODE_SIGN_IDENTITY = "-"; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 414 | ENABLE_NS_ASSERTIONS = NO; 415 | ENABLE_STRICT_OBJC_MSGSEND = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu99; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | MACOSX_DEPLOYMENT_TARGET = 10.12; 425 | MTL_ENABLE_DEBUG_INFO = NO; 426 | SDKROOT = macosx; 427 | }; 428 | name = Release; 429 | }; 430 | 89B8ACFA1D55A68D001D4144 /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | COMBINE_HIDPI_IMAGES = YES; 435 | INFOPLIST_FILE = Assets/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.Assets; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_VERSION = 3.0; 440 | }; 441 | name = Debug; 442 | }; 443 | 89B8ACFB1D55A68D001D4144 /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 447 | COMBINE_HIDPI_IMAGES = YES; 448 | INFOPLIST_FILE = Assets/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 450 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.Assets; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 453 | SWIFT_VERSION = 3.0; 454 | }; 455 | name = Release; 456 | }; 457 | 89B8ACFD1D55A68D001D4144 /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | BUNDLE_LOADER = "$(TEST_HOST)"; 461 | COMBINE_HIDPI_IMAGES = YES; 462 | INFOPLIST_FILE = AssetsTests/Info.plist; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.AssetsTests; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_VERSION = 3.0; 467 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Assets.app/Contents/MacOS/Assets"; 468 | }; 469 | name = Debug; 470 | }; 471 | 89B8ACFE1D55A68D001D4144 /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | BUNDLE_LOADER = "$(TEST_HOST)"; 475 | COMBINE_HIDPI_IMAGES = YES; 476 | INFOPLIST_FILE = AssetsTests/Info.plist; 477 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 478 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.AssetsTests; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 481 | SWIFT_VERSION = 3.0; 482 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Assets.app/Contents/MacOS/Assets"; 483 | }; 484 | name = Release; 485 | }; 486 | 89B8AD001D55A68D001D4144 /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | COMBINE_HIDPI_IMAGES = YES; 490 | INFOPLIST_FILE = AssetsUITests/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.AssetsUITests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | SWIFT_VERSION = 3.0; 495 | TEST_TARGET_NAME = Assets; 496 | }; 497 | name = Debug; 498 | }; 499 | 89B8AD011D55A68D001D4144 /* Release */ = { 500 | isa = XCBuildConfiguration; 501 | buildSettings = { 502 | COMBINE_HIDPI_IMAGES = YES; 503 | INFOPLIST_FILE = AssetsUITests/Info.plist; 504 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 505 | PRODUCT_BUNDLE_IDENTIFIER = com.arnaudthiercelin.AssetsUITests; 506 | PRODUCT_NAME = "$(TARGET_NAME)"; 507 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 508 | SWIFT_VERSION = 3.0; 509 | TEST_TARGET_NAME = Assets; 510 | }; 511 | name = Release; 512 | }; 513 | /* End XCBuildConfiguration section */ 514 | 515 | /* Begin XCConfigurationList section */ 516 | 89B8ACCD1D55A68D001D4144 /* Build configuration list for PBXProject "Assets" */ = { 517 | isa = XCConfigurationList; 518 | buildConfigurations = ( 519 | 89B8ACF71D55A68D001D4144 /* Debug */, 520 | 89B8ACF81D55A68D001D4144 /* Release */, 521 | ); 522 | defaultConfigurationIsVisible = 0; 523 | defaultConfigurationName = Release; 524 | }; 525 | 89B8ACF91D55A68D001D4144 /* Build configuration list for PBXNativeTarget "Assets" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | 89B8ACFA1D55A68D001D4144 /* Debug */, 529 | 89B8ACFB1D55A68D001D4144 /* Release */, 530 | ); 531 | defaultConfigurationIsVisible = 0; 532 | defaultConfigurationName = Release; 533 | }; 534 | 89B8ACFC1D55A68D001D4144 /* Build configuration list for PBXNativeTarget "AssetsTests" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | 89B8ACFD1D55A68D001D4144 /* Debug */, 538 | 89B8ACFE1D55A68D001D4144 /* Release */, 539 | ); 540 | defaultConfigurationIsVisible = 0; 541 | defaultConfigurationName = Release; 542 | }; 543 | 89B8ACFF1D55A68D001D4144 /* Build configuration list for PBXNativeTarget "AssetsUITests" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | 89B8AD001D55A68D001D4144 /* Debug */, 547 | 89B8AD011D55A68D001D4144 /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | /* End XCConfigurationList section */ 553 | }; 554 | rootObject = 89B8ACCA1D55A68D001D4144 /* Project object */; 555 | } 556 | -------------------------------------------------------------------------------- /Assets/Assets.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Assets/Assets/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/5/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | 16 | func applicationDidFinishLaunching(_ aNotification: Notification) { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | func applicationWillTerminate(_ aNotification: Notification) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Assets/Assets/AssetCellView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AssetCellView.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/7/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class AssetCellView: NSTableCellView { 12 | 13 | // imageView -> image 14 | // textField -> assetName 15 | @IBOutlet var assetPathField : NSTextField! 16 | @IBOutlet var assetSizeField : NSTextField! 17 | 18 | override func draw(_ dirtyRect: NSRect) { 19 | super.draw(dirtyRect) 20 | 21 | // Drawing code here. 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16@1x.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128w@1x.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256@1x.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_128@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_128w@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_128w@1x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_16@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_16@1x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_16@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_256@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_256@1x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_256@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_32@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_32@1x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_32@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_512@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_512@1x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/AppIcon.appiconset/app_icon_512@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Designer Folder icon_21.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Designer Folder icon_21@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Designer Folder icon_21@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Designer Folder icon_21.imageset/Designer Folder icon_21@3x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Project Folder Icon_21.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Project Folder Icon_21@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "Project Folder Icon_21@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21@2x.png -------------------------------------------------------------------------------- /Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets/Assets/Assets.xcassets/Project Folder Icon_21.imageset/Project Folder Icon_21@3x.png -------------------------------------------------------------------------------- /Assets/Assets/AssetsPair.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AssetsPair.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/12/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class AssetsPair: NSObject, NSCoding { 12 | var projectAsset: ImageFile! 13 | var designerAsset: ImageFile! 14 | 15 | override init() { // NS_DESIGNATED_INITIALIZER 16 | 17 | } 18 | 19 | required public init?(coder aDecoder: NSCoder) { 20 | let projectAsset = aDecoder.decodeObject(forKey: "projectAsset") 21 | if projectAsset != nil { 22 | self.projectAsset = projectAsset as! ImageFile 23 | } 24 | 25 | let designerAsset = aDecoder.decodeObject(forKey: "designerAsset") 26 | if designerAsset != nil { 27 | self.designerAsset = designerAsset as! ImageFile 28 | } 29 | } 30 | 31 | public func encode(with aCoder: NSCoder) { 32 | if self.projectAsset != nil { 33 | aCoder.encode(self.projectAsset, forKey: "projectAsset") 34 | } 35 | 36 | if self.designerAsset != nil { 37 | aCoder.encode(self.designerAsset, forKey: "designerAsset") 38 | } 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Assets/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | Default 512 | 513 | 514 | 515 | 516 | 517 | 518 | Left to Right 519 | 520 | 521 | 522 | 523 | 524 | 525 | Right to Left 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | Default 537 | 538 | 539 | 540 | 541 | 542 | 543 | Left to Right 544 | 545 | 546 | 547 | 548 | 549 | 550 | Right to Left 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 823 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 866 | 876 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | -------------------------------------------------------------------------------- /Assets/Assets/Document.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Document.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/5/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class Document: NSDocument { 12 | 13 | var projectDirectoryURL: URL! 14 | var designerDirectoryURL: URL! 15 | var assetsList = [AssetsPair]() 16 | 17 | override init() { 18 | super.init() 19 | // Add your subclass-specific initialization here. 20 | } 21 | 22 | override class func autosavesInPlace() -> Bool { 23 | return true 24 | } 25 | 26 | override func makeWindowControllers() { 27 | // Returns the Storyboard that contains your Document window. 28 | let storyboard = NSStoryboard(name: "Main", bundle: nil) 29 | let windowController = storyboard.instantiateController(withIdentifier: "Document Window Controller") as! NSWindowController 30 | 31 | self.addWindowController(windowController) 32 | 33 | let viewController = windowController.contentViewController as! ViewController 34 | viewController.representedObject = self 35 | } 36 | 37 | override func data(ofType typeName: String) throws -> Data { 38 | 39 | var rootObject = [String : Any]() 40 | if self.projectDirectoryURL != nil { 41 | rootObject["projectDirectoryURL"] = projectDirectoryURL 42 | } 43 | if self.designerDirectoryURL != nil { 44 | rootObject["designerDirectoryURL"] = designerDirectoryURL 45 | } 46 | rootObject["assetsList"] = assetsList 47 | let data = NSKeyedArchiver.archivedData(withRootObject: rootObject) 48 | 49 | return data 50 | } 51 | 52 | override func read(from data: Data, ofType typeName: String) throws { 53 | // TODO: run this on background thread, show a loading anim until done. 54 | guard let unarchivedObject = NSKeyedUnarchiver.unarchiveObject(with: data) as! [String : Any]? else { 55 | NSLog("Error loading the unarchived Object") 56 | return; 57 | } 58 | 59 | self.projectDirectoryURL = unarchivedObject["projectDirectoryURL"] as? URL 60 | self.designerDirectoryURL = unarchivedObject["designerDirectoryURL"] as? URL 61 | self.assetsList = unarchivedObject["assetsList"] as! [AssetsPair] 62 | 63 | } 64 | 65 | // MARK: - Data 66 | 67 | func addAssetPair(_ assetPair: AssetsPair) { 68 | // TODO: Thread safety here 69 | self.assetsList.append(assetPair) 70 | } 71 | 72 | func resetAllData() { 73 | self.projectDirectoryURL = nil 74 | self.designerDirectoryURL = nil 75 | self.assetsList.removeAll() 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /Assets/Assets/ImageFile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFile.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/12/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class ImageFile: NSObject, NSCoding { 12 | var fileName: String! 13 | var url: URL! { 14 | didSet { 15 | self.fileName = self.url.lastPathComponent 16 | self.image = NSImage(contentsOf: self.url) 17 | } 18 | } 19 | 20 | var image: NSImage! 21 | 22 | override init() { // NS_DESIGNATED_INITIALIZER 23 | 24 | } 25 | 26 | required public init?(coder aDecoder: NSCoder) { 27 | let url = aDecoder.decodeObject(forKey: "url") 28 | if url != nil { 29 | self.url = url as! URL 30 | self.fileName = self.url.lastPathComponent 31 | self.image = NSImage(contentsOf: self.url) 32 | } 33 | } 34 | 35 | public func encode(with aCoder: NSCoder) { 36 | if self.url != nil { 37 | aCoder.encode(self.url, forKey: "url") 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Assets/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | assetsproject 13 | 14 | CFBundleTypeIconFile 15 | document_icon_512@2x 16 | CFBundleTypeName 17 | Assets Project 18 | CFBundleTypeOSTypes 19 | 20 | ???? 21 | 22 | CFBundleTypeRole 23 | Editor 24 | LSItemContentTypes 25 | 26 | com.arnaudthiercelin.AssetsProject 27 | 28 | LSTypeIsPackage 29 | 1 30 | NSDocumentClass 31 | $(PRODUCT_MODULE_NAME).Document 32 | 33 | 34 | CFBundleExecutable 35 | $(EXECUTABLE_NAME) 36 | CFBundleIconFile 37 | 38 | CFBundleIdentifier 39 | $(PRODUCT_BUNDLE_IDENTIFIER) 40 | CFBundleInfoDictionaryVersion 41 | 6.0 42 | CFBundleName 43 | $(PRODUCT_NAME) 44 | CFBundlePackageType 45 | APPL 46 | CFBundleShortVersionString 47 | 0.1 48 | CFBundleSignature 49 | ???? 50 | CFBundleVersion 51 | 1 52 | LSMinimumSystemVersion 53 | $(MACOSX_DEPLOYMENT_TARGET) 54 | NSHumanReadableCopyright 55 | Copyright © 2016 Arnaud Thiercelin. All rights reserved. 56 | NSMainStoryboardFile 57 | Main 58 | NSPrincipalClass 59 | NSApplication 60 | UTExportedTypeDeclarations 61 | 62 | 63 | UTTypeConformsTo 64 | 65 | public.data 66 | 67 | UTTypeDescription 68 | Assets Project 69 | UTTypeIconFile 70 | document_icon_512@2x 71 | UTTypeIdentifier 72 | com.arnaudthiercelin.AssetsProject 73 | UTTypeTagSpecification 74 | 75 | public.filename-extension 76 | 77 | assetsproject 78 | 79 | 80 | 81 | 82 | UTImportedTypeDeclarations 83 | 84 | 85 | UTTypeConformsTo 86 | 87 | public.data 88 | 89 | UTTypeDescription 90 | Assets Project 91 | UTTypeIconFile 92 | document_icon_512@2x 93 | UTTypeIdentifier 94 | com.arnaudthiercelin.AssetsProject 95 | UTTypeTagSpecification 96 | 97 | public.filename-extension 98 | 99 | assetsproject 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /Assets/Assets/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Assets 4 | // 5 | // Created by Arnaud Thiercelin on 8/5/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class ViewController: NSViewController, NSTableViewDataSource, NSTableViewDelegate{ 12 | 13 | @IBOutlet var projectURLField: NSTextField! 14 | @IBOutlet var chooseProjectURLButton: NSButton! 15 | @IBOutlet var designerURLField: NSTextField! 16 | @IBOutlet var assetsTableView: NSTableView! 17 | @IBOutlet var assetsStatusField: NSTextField! 18 | @IBOutlet var publishButton: NSButton! 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | 23 | // Do any additional setup after loading the view. 24 | self.assetsStatusField.stringValue = "" 25 | self.assetsTableView.delegate = self 26 | self.assetsTableView.dataSource = self 27 | self.assetsTableView.register(forDraggedTypes: [kUTTypeFileURL as String]) 28 | } 29 | 30 | override var representedObject: Any? { 31 | didSet { 32 | // Update the view, if already loaded. 33 | } 34 | } 35 | 36 | var document: Document! { 37 | get { 38 | return representedObject as? Document 39 | } 40 | } 41 | 42 | override func viewWillAppear() { 43 | if self.document != nil { 44 | if self.document.projectDirectoryURL != nil { 45 | self.projectURLField.stringValue = self.document.projectDirectoryURL.path.replacingOccurrences(of: NSHomeDirectory(), with: "~") 46 | } 47 | if self.document.designerDirectoryURL != nil { 48 | self.designerURLField.stringValue = self.document.designerDirectoryURL.path.replacingOccurrences(of: NSHomeDirectory(), with: "~") 49 | } 50 | self.assetsTableView.reloadData() 51 | } 52 | } 53 | 54 | @IBAction func chooseProjectURL(_ sender: AnyObject) { 55 | let openPanel = NSOpenPanel() 56 | 57 | openPanel.canChooseDirectories = true 58 | openPanel.canChooseFiles = false 59 | openPanel.allowsMultipleSelection = false 60 | openPanel.title = NSLocalizedString("Choose Project URL", comment: "Open Panel title") 61 | openPanel.message = NSLocalizedString("Please select the root folder of your project", comment: "Open Panel Message") 62 | 63 | openPanel.beginSheetModal(for: self.view.window!, completionHandler: { [unowned self] (response: NSModalResponse) in 64 | if response == NSFileHandlingPanelOKButton { 65 | guard let rootDirectory = openPanel.url else { 66 | NSLog("Invalid root directory for project") 67 | return 68 | } 69 | 70 | self.projectURLField.stringValue = rootDirectory.path.replacingOccurrences(of: NSHomeDirectory(), with: "~") 71 | guard rootDirectory.startAccessingSecurityScopedResource() == true else { 72 | NSLog("Failed to start accessing rootDirectory in Sandbox environment.") 73 | return 74 | } 75 | 76 | // clear model here. 77 | // assign root directory value 78 | self.document.projectDirectoryURL = rootDirectory 79 | 80 | // trigger parsing of path. 81 | self.findAllAssets(inside: rootDirectory.path) 82 | 83 | // Update assets status Field 84 | let assetCount = self.document.assetsList.count 85 | self.assetsStatusField.stringValue = "\(assetCount) assets" 86 | self.assetsTableView.reloadData() 87 | 88 | DispatchQueue.main.async { 89 | let notification = NSUserNotification() 90 | notification.title = NSLocalizedString("Parsing Finished", comment: "NSUserNotification title") 91 | notification.informativeText = NSLocalizedString("\(assetCount) assets were found", comment: "NSUserNotification informativeText") 92 | notification.soundName = NSUserNotificationDefaultSoundName 93 | 94 | NSUserNotificationCenter.default.deliver(notification) 95 | } 96 | } 97 | }) 98 | } 99 | 100 | 101 | @IBAction func chooseDesignerURL(_ sender: AnyObject) { 102 | var hasOnePair = false 103 | 104 | for assetPair in self.document.assetsList { 105 | if assetPair.projectAsset != nil && 106 | assetPair.designerAsset != nil { 107 | hasOnePair = true 108 | break 109 | } 110 | } 111 | 112 | let alert = NSAlert() 113 | 114 | // We give proper notice to the user about the upcoming behaviors. 115 | if hasOnePair == false { // we tell the user we will parse and match. 116 | alert.messageText = NSLocalizedString("You have at least one matching pair of assets", comment: "Choose designer folder Alert Message") 117 | alert.informativeText = NSLocalizedString("Choosing a designer directory in this state will rebase your current designer assets. Do you wish to proceed?", comment: "Choose designer folder alert informative message") 118 | alert.addButton(withTitle: NSLocalizedString("OK", comment: "Alert at Choose designer folder OK Button")) 119 | alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "Alert at choose designer folder cancel button")) 120 | let returnValue = alert.runModal() 121 | 122 | if returnValue == NSModalResponseCancel { 123 | return 124 | } 125 | 126 | } else { // we replace the root dir for the assets. 127 | alert.messageText = NSLocalizedString("You have no matching pair of assets", comment: "Choose designer folder Alert Message") 128 | alert.informativeText = NSLocalizedString("Choosing a designer directory in this state will look for assets in the chosen folder and try to auto match. Do you wish to proceed?", comment: "Choose designer folder alert informative message") 129 | alert.addButton(withTitle: NSLocalizedString("OK", comment: "Alert at Choose designer folder OK Button")) 130 | alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "Alert at choose designer folder cancel button")) 131 | let returnValue = alert.runModal() 132 | 133 | if returnValue == NSModalResponseCancel { 134 | return 135 | } 136 | } 137 | 138 | let openPanel = NSOpenPanel() 139 | 140 | openPanel.canChooseDirectories = true 141 | openPanel.canChooseFiles = false 142 | openPanel.allowsMultipleSelection = false 143 | openPanel.title = NSLocalizedString("Choose Project URL", comment: "Open Panel title") 144 | openPanel.message = NSLocalizedString("Please select the root folder of your project", comment: "Open Panel Message") 145 | 146 | openPanel.beginSheetModal(for: self.view.window!, completionHandler: { [unowned self] (response: NSModalResponse) in 147 | if response == NSFileHandlingPanelOKButton { 148 | if hasOnePair == false { // if we have nothing, parse and automatch. 149 | 150 | } else { // if we have something, even 1 image, simple change the root folder of the assets. 151 | 152 | } 153 | } 154 | }) 155 | } 156 | 157 | @IBAction func publish(_ sender: AnyObject) { 158 | let fileManager = FileManager.default 159 | 160 | if self.document.projectDirectoryURL == nil { 161 | NSLog("Error publishing, no project directory") 162 | } else { 163 | var isDirectory: ObjCBool = ObjCBool(false) 164 | 165 | if fileManager.fileExists(atPath: self.document.projectDirectoryURL.path, isDirectory: &isDirectory) { 166 | if isDirectory.boolValue { 167 | let overwriteAlert = NSAlert() 168 | overwriteAlert.messageText = NSLocalizedString("You are about to publish your changes.", comment: "Overwrite Alert at Publish message") 169 | overwriteAlert.informativeText = NSLocalizedString("This will overwrite all the files within your project. Are you sure you wish to proceed?", comment: "Overwrite Alert at Publish informative text") 170 | overwriteAlert.addButton(withTitle: NSLocalizedString("OK", comment: "Overwrite Alert at Publish OK Button")) 171 | overwriteAlert.addButton(withTitle: NSLocalizedString("Cancel", comment: "Overwrite Alert at Publish cancel button")) 172 | 173 | let returnValue = overwriteAlert.runModal() 174 | 175 | if returnValue == NSModalResponseCancel { 176 | NSLog("User canceled publishing") 177 | return 178 | } 179 | 180 | for assetPair in self.document.assetsList { 181 | if assetPair.designerAsset == nil { 182 | continue; 183 | } 184 | 185 | guard let projectAssetURL = assetPair.projectAsset.url, let designerAssetURL = assetPair.designerAsset.url else { 186 | NSLog("Publishing Error: projectAssetURL or designerAssetURL nil") 187 | continue; 188 | } 189 | 190 | 191 | do { 192 | try fileManager.removeItem(at: projectAssetURL) 193 | 194 | do { 195 | try fileManager.copyItem(at: designerAssetURL, to: projectAssetURL) 196 | } catch { 197 | NSLog("Error copying new asset at \(projectAssetURL) to old asset at \(projectAssetURL)") 198 | // FIXME: Add a notification to user 199 | } 200 | } catch { 201 | NSLog("Error removing old asset at \(projectAssetURL)") 202 | // FIXME: Add a notification to user 203 | } 204 | } 205 | } else { 206 | let overwriteAlert = NSAlert() 207 | overwriteAlert.messageText = NSLocalizedString("Error Publishing", comment: "Invalid Directory Alert at Publish message") 208 | overwriteAlert.informativeText = NSLocalizedString("Can't publish, root directory is not a folder, risk of errors", comment: "Invalid Directory Alert at Publish informative text") 209 | overwriteAlert.addButton(withTitle: NSLocalizedString("OK", comment: "Invalid Directory Alert at Publish OK Button")) 210 | 211 | overwriteAlert.runModal() 212 | NSLog("Can't publish, projectDirectory is not a directory") 213 | } 214 | } 215 | DispatchQueue.main.async { 216 | let notification = NSUserNotification() 217 | notification.title = NSLocalizedString("Publish Finished", comment: "NSUserNotification title") 218 | notification.informativeText = NSLocalizedString("Your new assets have been moved to their new location", comment: "NSUserNotification informativeText") 219 | notification.soundName = NSUserNotificationDefaultSoundName 220 | 221 | NSUserNotificationCenter.default.deliver(notification) 222 | 223 | self.assetsTableView.reloadData() 224 | } 225 | } 226 | } 227 | 228 | 229 | func findAllAssets(inside startingPath: String) -> Void { 230 | 231 | let fileManager = FileManager.default 232 | 233 | do { 234 | let content = try fileManager.contentsOfDirectory(atPath: startingPath) 235 | 236 | for elementName in content { 237 | let startingPathNSString = startingPath as NSString 238 | let elementPath = startingPathNSString.appendingPathComponent(elementName) 239 | 240 | var isDirectory: ObjCBool = ObjCBool(false) 241 | let fileExists = fileManager.fileExists(atPath: elementPath, isDirectory: &isDirectory) 242 | 243 | if fileExists && isDirectory.boolValue == true { // -- These are folder, we need to dive in eventually. 244 | // Skipping directories which can't be opened. 245 | if fileManager.isExecutableFile(atPath: elementPath) == false { 246 | continue; 247 | } 248 | 249 | // Skipping hidden folders 250 | let hiddenFolderRange = elementName.range(of: ".") 251 | if hiddenFolderRange?.isEmpty == false && 252 | hiddenFolderRange?.lowerBound == elementName.startIndex { 253 | 254 | } 255 | 256 | // We open the folder and continue processing 257 | self.findAllAssets(inside: elementPath) 258 | } else { // -- These are files, we need to add if valid assets. 259 | let elementNSString = elementName as NSString 260 | let UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, elementNSString.pathExtension as CFString, nil)?.takeRetainedValue() 261 | 262 | guard UTI != nil else { 263 | NSLog("Failed to create UTI for \(elementPath)") 264 | continue 265 | } 266 | 267 | if UTTypeConformsTo(UTI!, kUTTypeImage) { 268 | let newAssetsPair = AssetsPair() 269 | let newProjectImage = ImageFile() 270 | 271 | newProjectImage.url = URL(fileURLWithPath: elementPath) 272 | newAssetsPair.projectAsset = newProjectImage 273 | 274 | self.document.addAssetPair(newAssetsPair) 275 | } 276 | //DispatchQueue.main.async { 277 | // self.assetsTableView.reloadData() 278 | //} 279 | } 280 | } 281 | 282 | } catch { 283 | NSLog("Error during reading content of path \(startingPath): \(error)") 284 | } 285 | } 286 | 287 | // MARK: - NSTableViewDataSource & NSTableViewDelegate 288 | 289 | 290 | func numberOfRows(in tableView: NSTableView) -> Int { 291 | return self.document != nil ? self.document.assetsList.count : 0 292 | } 293 | 294 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { 295 | let cellView = tableView.make(withIdentifier: "AssetCellView", owner: self) as! AssetCellView 296 | let assetPair = self.document.assetsList[row] 297 | 298 | let assetFile = tableColumn?.identifier == "project_asset" ? assetPair.projectAsset : assetPair.designerAsset 299 | 300 | if assetFile != nil { 301 | cellView.textField?.stringValue = assetFile!.fileName 302 | cellView.assetPathField.stringValue = assetFile!.url.path.replacingOccurrences(of: NSHomeDirectory(), with: "~") 303 | cellView.imageView?.image = assetFile!.image 304 | cellView.assetSizeField.stringValue = String(format:"%.0fx%.0f", assetFile!.image.size.width, assetFile!.image.size.height) 305 | } else { 306 | cellView.textField?.stringValue = "" 307 | cellView.assetPathField.stringValue = "" 308 | cellView.assetSizeField.stringValue = "" 309 | cellView.imageView?.image = nil 310 | } 311 | return cellView 312 | } 313 | 314 | // MARK: Drag and Drop 315 | 316 | func tableView(_ tableView: NSTableView, writeRowsWith rowIndexes: IndexSet, to pboard: NSPasteboard) -> Bool { 317 | return false 318 | } 319 | 320 | func tableView(_ tableView: NSTableView, validateDrop info: NSDraggingInfo, proposedRow row: Int, proposedDropOperation dropOperation: NSTableViewDropOperation) -> NSDragOperation { 321 | //get the file URLs from the pasteboard 322 | let pasteBoard = info.draggingPasteboard() 323 | 324 | //list the file type UTIs we want to accept 325 | let acceptedTypes = [kUTTypeImage] 326 | 327 | guard let urls = pasteBoard.readObjects(forClasses: [NSURL.self], 328 | options: [NSPasteboardURLReadingFileURLsOnlyKey : true, 329 | NSPasteboardURLReadingContentsConformToTypesKey : acceptedTypes]) else { 330 | NSLog("Error accepting the drop") 331 | return [] 332 | } 333 | 334 | //only allow drag if there is exactly one file 335 | if urls.count != 1 || dropOperation != NSTableViewDropOperation.on { 336 | return [] //NSDragOperationNone in Swift 3.0 337 | } 338 | 339 | return NSDragOperation.copy 340 | 341 | } 342 | 343 | 344 | func tableView(_ tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableViewDropOperation) -> Bool { 345 | //get the file URLs from the pasteboard 346 | let pasteBoard = info.draggingPasteboard() 347 | 348 | //list the file type UTIs we want to accept 349 | let acceptedTypes = [kUTTypeImage] 350 | 351 | guard let urls = pasteBoard.readObjects(forClasses: [NSURL.self], 352 | options: [NSPasteboardURLReadingFileURLsOnlyKey : true, 353 | NSPasteboardURLReadingContentsConformToTypesKey : acceptedTypes]) else { 354 | NSLog("Error accepting the drop") 355 | return false 356 | } 357 | 358 | //only allow drag if there is exactly one file 359 | if urls.count != 1 || dropOperation != NSTableViewDropOperation.on { 360 | return false 361 | } 362 | 363 | let draggedFileURL = urls[0] as! NSURL 364 | let imagePair = self.document.assetsList[row] 365 | let newDesignerImage = ImageFile() 366 | newDesignerImage.url = draggedFileURL as URL 367 | 368 | imagePair.designerAsset = newDesignerImage 369 | 370 | DispatchQueue.main.async { 371 | self.assetsTableView.reloadData() 372 | } 373 | 374 | return true 375 | } 376 | 377 | } 378 | 379 | -------------------------------------------------------------------------------- /Assets/AssetsTests/AssetsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AssetsTests.swift 3 | // AssetsTests 4 | // 5 | // Created by Arnaud Thiercelin on 8/5/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Assets 11 | 12 | class AssetsTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Assets/AssetsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Assets/AssetsUITests/AssetsUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AssetsUITests.swift 3 | // AssetsUITests 4 | // 5 | // Created by Arnaud Thiercelin on 8/5/16. 6 | // Copyright © 2016 Arnaud Thiercelin. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class AssetsUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Assets/AssetsUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Assets_icon.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Assets_icon.sketch -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Arnaud Thiercelin 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Assets 2 | Assets is a macOS app that manages assets for your developement projects (Xcode, web, etc) 3 | 4 | ## How it works - First run 5 | 1/ Choose a project root folder. 6 | Assets will browse it and collect all assets 7 | 8 | 2/ Place Designer assets by either choosing a root folder or drag and dropping images. 9 | 10 | 3/ Click on Publish to replace all projects assets with the designer's assets. 11 | 12 | 4/ Save the file and reuse when new assets available. 13 | 14 | ## How it works - New Assets for your project. 15 | 1/ Open your saved assets file. 16 | 17 | 2/ If your new assets are in the same path as before and have the same names, simply click publish. 18 | 19 | 3/ If your new assets are in a different folder but have the same names, choose the new root Designer folder and then click publish. 20 | 21 | 4/ If your new assets are in a different folder and have different names, go back to first run. 22 | 23 | ## Screenshots 24 | ![Screenshot](https://github.com/athiercelin/Assets/blob/master/Screenshots/Assets-01.png?raw=true) 25 | 26 | ## Questions & Contact 27 | If you have any questions, reach out to me on twitter [@athiercelin](https://twitter.com/athiercelin) or drop an issue on github. -------------------------------------------------------------------------------- /Screenshots/Assets-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/Screenshots/Assets-01.png -------------------------------------------------------------------------------- /document_icon_512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e7711bbear/Assets/2bc30fbc979d0d06235fcf2c406d5db0a0db9f2c/document_icon_512@2x.png --------------------------------------------------------------------------------