Skip to content

Commit

Permalink
Merge pull request #33 from Nonchalant/release_0_3_2
Browse files Browse the repository at this point in the history
0.3.2
  • Loading branch information
Nonchalant authored Nov 29, 2017
2 parents 402ee33 + 889b41b commit 3f73f17
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OS?=sierra
PREFIX?=/usr/local
PROJECT?=AppIcon
RELEASE_BINARY_FOLDER?=$(BUILD_FOLDER)/release/$(PROJECT)
VERSION?=0.3.1
VERSION?=0.3.2

build:
swift build -c release -Xswiftc -static-stdlib
Expand Down
43 changes: 43 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"object": {
"pins": [
{
"package": "Commander",
"repositoryURL": "https://github.com/kylef/Commander",
"state": {
"branch": null,
"revision": "e5b50ad7b2e91eeb828393e89b03577b16be7db9",
"version": "0.8.0"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "e34d5687e1e9d865e3527dd58bc2f7464ef6d936",
"version": "0.8.0"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell.git",
"state": {
"branch": null,
"revision": "cdb243acd5c6cf5a9628ff003df0457ae4d0d31a",
"version": "3.0.0"
}
},
{
"package": "SwiftyJSON",
"repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state": {
"branch": null,
"revision": "dadbfcffd5f51e2b488a26e83f188d96755e5393",
"version": "3.1.4"
}
}
]
},
"version": 1
}
29 changes: 18 additions & 11 deletions Sources/AppIconCore/Icon/AppIcons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,23 @@ struct AppIconSet {
public enum AppIcons: Float {
// iPhone
case notification = 20.0
case settings = 29.0
case spotlight = 40.0
case iphoneApp = 60.0
case settings = 29.0
case spotlight = 40.0
case iphoneApp = 60.0

// marketing
case marketing = 1024.0

// iPad
case iPadApp = 76.0
case iPadProApp = 83.5
case iPadApp = 76.0
case iPadProApp = 83.5

// Mac
case macSmall2 = 16.0
case macSmall = 32.0
case macMedium = 128.0
case macLarge = 256.0
case macLarge2 = 512.0
case macSmall2 = 16.0
case macSmall = 32.0
case macMedium = 128.0
case macLarge = 256.0
case macLarge2 = 512.0

static func all(with platforms: [Platform]) -> [AppIconSet] {
return platforms
Expand All @@ -84,7 +87,11 @@ public enum AppIcons: Float {
}

private func set(with platform: Platform = .iphone) -> AppIconSet {
let scales = (self == .iPadProApp) ? [Scale.twice] : nil
let scales = twiceOnly.contains(self) ? [Scale.twice] : nil
return AppIconSet(baseSize: self.rawValue, platform: platform, scales: scales)
}

private var twiceOnly: [AppIcons] {
return [.iPadProApp]
}
}
11 changes: 8 additions & 3 deletions Sources/AppIconCore/Icon/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import Foundation

public enum Platform: String {
case iphone = "iphone"
case marketing = "ios-marketing"
case ipad = "ipad"
case mac = "mac"

var scales: [Scale] {
switch self {
case .iphone:
return [.twice, .triple]
case .marketing:
return [.single]
case .ipad, .mac:
return [.single, .twice]
}
Expand All @@ -26,6 +29,8 @@ public enum Platform: String {
switch self {
case .iphone:
return [.notification, .settings, .spotlight, .iphoneApp]
case .marketing:
return [.marketing]
case .ipad:
return [.notification, .settings, .spotlight, .iPadApp, .iPadProApp]
case .mac:
Expand All @@ -36,13 +41,13 @@ public enum Platform: String {
public static func platforms(ipad: Bool, mac: Bool) -> [Platform] {
switch (ipad, mac) {
case (true, true):
return [.iphone, .ipad, .mac]
return [.iphone, .ipad, .marketing, .mac]
case (true, false):
return [.iphone, .ipad]
return [.iphone, .ipad, .marketing]
case (false, true):
return [.mac]
case (false, false):
return [.iphone]
return [.iphone, .marketing]
}
}
}

0 comments on commit 3f73f17

Please sign in to comment.