mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-16 12:16:42 +00:00
Fix alternate app icons
This commit is contained in:
parent
03e5a960d2
commit
aef4d86853
12 changed files with 102 additions and 6 deletions
|
@ -6,11 +6,21 @@ struct IconSelectorView: View {
|
|||
self.rawValue
|
||||
}
|
||||
|
||||
case primary = "AppIconInApp"
|
||||
case primary = "AppIcon"
|
||||
case alternate1 = "AppIconAlternate1"
|
||||
case alternate2 = "AppIconAlternate2"
|
||||
case alternate3 = "AppIconAlternate3"
|
||||
case alternate4 = "AppIconAlternate4"
|
||||
|
||||
var iconName: String {
|
||||
switch self {
|
||||
case .primary: return "icon0"
|
||||
case .alternate1: return "icon1"
|
||||
case .alternate2: return "icon2"
|
||||
case .alternate3: return "icon3"
|
||||
case .alternate4: return "icon4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@State private var currentIcon = UIApplication.shared.alternateIconName ?? Icon.primary.rawValue
|
||||
|
@ -31,7 +41,7 @@ struct IconSelectorView: View {
|
|||
}
|
||||
} label: {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
Image(uiImage: .init(named: icon.rawValue) ?? .init())
|
||||
Image(uiImage: .init(named: icon.iconName) ?? .init())
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(minHeight: 125, maxHeight: 1024)
|
||||
|
|
|
@ -96,10 +96,12 @@ struct SettingsTabs: View {
|
|||
Label {
|
||||
Text("Icon selector")
|
||||
} icon: {
|
||||
Image(uiImage: .init(named: UIApplication.shared.alternateIconName ?? "AppIconInApp")!)
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
.cornerRadius(4)
|
||||
if let icon = IconSelectorView.Icon(rawValue: UIApplication.shared.alternateIconName ?? "AppIcon") {
|
||||
Image(uiImage: .init(named: icon.iconName)!)
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
.cornerRadius(4)
|
||||
}
|
||||
}
|
||||
}
|
||||
Link(destination: URL(string: "https://github.com/Dimillian/IceCubesApp")!) {
|
||||
|
|
Before Width: | Height: | Size: 986 KiB After Width: | Height: | Size: 986 KiB |
21
IceCubesApp/Assets.xcassets/icon1.imageset/Contents.json
vendored
Normal file
21
IceCubesApp/Assets.xcassets/icon1.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "icon.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
IceCubesApp/Assets.xcassets/icon1.imageset/icon.png
vendored
Normal file
BIN
IceCubesApp/Assets.xcassets/icon1.imageset/icon.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
21
IceCubesApp/Assets.xcassets/icon2.imageset/Contents.json
vendored
Normal file
21
IceCubesApp/Assets.xcassets/icon2.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "icon.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
IceCubesApp/Assets.xcassets/icon2.imageset/icon.png
vendored
Normal file
BIN
IceCubesApp/Assets.xcassets/icon2.imageset/icon.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
21
IceCubesApp/Assets.xcassets/icon3.imageset/Contents.json
vendored
Normal file
21
IceCubesApp/Assets.xcassets/icon3.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "icon.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
IceCubesApp/Assets.xcassets/icon3.imageset/icon.png
vendored
Normal file
BIN
IceCubesApp/Assets.xcassets/icon3.imageset/icon.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,016 KiB |
21
IceCubesApp/Assets.xcassets/icon4.imageset/Contents.json
vendored
Normal file
21
IceCubesApp/Assets.xcassets/icon4.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "icon.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
IceCubesApp/Assets.xcassets/icon4.imageset/icon.png
vendored
Normal file
BIN
IceCubesApp/Assets.xcassets/icon4.imageset/icon.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
Loading…
Reference in a new issue