Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #68 from SwiftGen/feature/xcassets-colors
Browse files Browse the repository at this point in the history
Asset Catalog - Named Colors
  • Loading branch information
djbe authored Aug 20, 2017
2 parents 42d343c + d4914b2 commit 85bbd85
Show file tree
Hide file tree
Showing 46 changed files with 1,830 additions and 898 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ _None_
* Swift 4 templates.
[David Jennes](https://github.com/djbe)
[#67](https://github.com/SwiftGen/templates/pull/67)
* XCAssets: Added support for named colors.
[David Jennes](https://github.com/djbe)
[#68](https://github.com/SwiftGen/templates/pull/68)

### Internal Changes

Expand Down
181 changes: 181 additions & 0 deletions Contexts/XCAssets/all.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>catalogs</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Background</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>24Vision/Background</string>
</dict>
<dict>
<key>name</key>
<string>Primary</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>24Vision/Primary</string>
</dict>
</array>
<key>name</key>
<string>24Vision</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>Orange</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Orange</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Primary</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>Vengo/Primary</string>
</dict>
<dict>
<key>name</key>
<string>Tint</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>Vengo/Tint</string>
</dict>
</array>
<key>name</key>
<string>Vengo</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
<string>Colors</string>
</dict>
<dict>
<key>assets</key>
<array>
<dict>
<key>items</key>
<array/>
<key>name</key>
<string>Empty</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Banana</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Exotic/Banana</string>
</dict>
<dict>
<key>name</key>
<string>Mango</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Exotic/Mango</string>
</dict>
</array>
<key>name</key>
<string>Exotic</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>private</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>private</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Apricot</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Apricot</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Apple</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Apple</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Cherry</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Double/Cherry</string>
</dict>
</array>
<key>name</key>
<string>Double</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>Tomato</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Tomato</string>
</dict>
</array>
<key>name</key>
<string>Red</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
<string>Round</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
<string>Images</string>
</dict>
</array>
</dict>
</plist>
74 changes: 74 additions & 0 deletions Contexts/XCAssets/colors.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>catalogs</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Background</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>24Vision/Background</string>
</dict>
<dict>
<key>name</key>
<string>Primary</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>24Vision/Primary</string>
</dict>
</array>
<key>name</key>
<string>24Vision</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>Orange</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Orange</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Primary</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>Vengo/Primary</string>
</dict>
<dict>
<key>name</key>
<string>Tint</string>
<key>type</key>
<string>color</string>
<key>value</key>
<string>Vengo/Tint</string>
</dict>
</array>
<key>name</key>
<string>Vengo</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
<string>Colors</string>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,39 @@
<array/>
<key>name</key>
<string>Empty</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Banana</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Exotic/Banana</string>
</dict>
<dict>
<key>name</key>
<string>Mango</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Exotic/Mango</string>
</dict>
</array>
<key>name</key>
<string>Exotic</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>private</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>private</string>
</dict>
Expand All @@ -44,21 +54,19 @@
<dict>
<key>name</key>
<string>Apricot</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Apricot</string>
</dict>
<dict>
<key>name</key>
<string>Orange</string>
<key>value</key>
<string>Round/Orange</string>
</dict>
<dict>
<key>items</key>
<array>
<dict>
<key>name</key>
<string>Apple</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Apple</string>
</dict>
Expand All @@ -68,26 +76,36 @@
<dict>
<key>name</key>
<string>Cherry</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Double/Cherry</string>
</dict>
</array>
<key>name</key>
<string>Double</string>
<key>type</key>
<string>group</string>
</dict>
<dict>
<key>name</key>
<string>Tomato</string>
<key>type</key>
<string>image</string>
<key>value</key>
<string>Round/Tomato</string>
</dict>
</array>
<key>name</key>
<string>Red</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
<string>Round</string>
<key>type</key>
<string>group</string>
</dict>
</array>
<key>name</key>
Expand Down
8 changes: 8 additions & 0 deletions Documentation/MigrationGuide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Templates 2.1 Migration Guide

## Functionality changes in 2.1 (SwiftGen 5.1)

### XCAssets

The static `allValues` constant has been deprecated in favor of the `allImages` and `allColors` constants. This is because we've added support for named colors in asset catalogs.

# Templates 2.0 Migration Guide

If you're moving from SwiftGen 4.x to SwiftGen 5.0, you'll need to be aware that some templates have been renamed, removed or merged with others. Follow this Migration Guide to use the new name for SwiftGen 5.x of the templates you were previously using with SwiftGen 4.x.
Expand Down
Loading

0 comments on commit 85bbd85

Please sign in to comment.