-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21a4289
commit 64bdc52
Showing
6 changed files
with
155 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
/* Skip images */ | ||
"skip-images" : { | ||
"patterns" : ["Watch App .*", "Bed.*"] | ||
}, | ||
|
||
|
||
/* Set which images to include. Defaults to ["png"] */ | ||
"valid-image-extensions" : ["png", "jpeg", "jpg", "tiff"], | ||
|
||
// Set the base rendering options | ||
"base" : { | ||
"template-rendering-intent" : "template" | ||
}, | ||
|
||
/* Apply properties based on the target device */ | ||
"devices" : [ | ||
{ | ||
"device-type" : "watch", | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} | ||
], | ||
|
||
/* By default images following the AppIcon-{size}.png naming convention | ||
will be treated as prerendered app icons and won't be exposed to Swift */ | ||
"app-icon" : { | ||
"pattern" : "Custom App Icon Name.*", | ||
"prerendered" : false /* Defaults to true */ | ||
}, | ||
|
||
/* Apply custom sets of properties to images matched by the given patterns */ | ||
"custom" : [ | ||
{ | ||
"patterns" : [".*Preview.*", "SleepDuration.*", "WakeTime.*"], | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// DeviceIdiom.swift | ||
// XCAssetPacker | ||
// | ||
// Created by Harry Jordan on 04/09/2017. | ||
// Copyright © 2017 Inquisitive Software. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
public enum DeviceIdiom: String { | ||
case watch, iPhone, iPad | ||
|
||
static var all: [DeviceIdiom] = [watch, iPhone, iPad] | ||
|
||
|
||
init?(_ idiomString: String) { | ||
let idiom = DeviceIdiom.all.first(where: { | ||
$0.idiomString.caseInsensitiveCompare(idiomString) == .orderedSame | ||
}) | ||
|
||
if let idiom = idiom { | ||
self = idiom | ||
} else { | ||
return nil | ||
} | ||
} | ||
|
||
|
||
var idiomString: String { | ||
// Keys used for xcasset properties | ||
switch self { | ||
case .watch: | ||
return "watch" | ||
|
||
case .iPhone: | ||
return "iphone" | ||
|
||
case .iPad: | ||
return "ipad" | ||
} | ||
} | ||
|
||
|
||
var configurationKey: String { | ||
// Keys used to match strings in the configuration .json | ||
return self.rawValue | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters