icons: change app icon screen was not showing icon previews - added tiny 75x75 imageset assets since iOS 18+ cannot use AppIconSet for UIImage(named:)
@@ -8,6 +8,8 @@
|
|||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Original</string>
|
<string>Original</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>iconName</key>
|
||||||
<string>AppIcon</string>
|
<string>AppIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
@@ -18,66 +20,88 @@
|
|||||||
<string>Blue</string>
|
<string>Blue</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Blue</string>
|
<string>Blue</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>BlueIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Dark</string>
|
<string>Dark</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Dark</string>
|
<string>Dark</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>DarkIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Honeydew</string>
|
<string>Honeydew</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Honeydew</string>
|
<string>Honeydew</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>HoneydewIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Pride</string>
|
<string>Pride</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Pride</string>
|
<string>Pride</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>PrideIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Sandy</string>
|
<string>Sandy</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Sandy</string>
|
<string>Sandy</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>SandyIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Sky</string>
|
<string>Sky</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Sky</string>
|
<string>Sky</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>SkyIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Snow</string>
|
<string>Snow</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Snow</string>
|
<string>Snow</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>SnowIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Starburst</string>
|
<string>Starburst</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Starburst</string>
|
<string>Starburst</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>StarburstIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Storm</string>
|
<string>Storm</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Storm</string>
|
<string>Storm</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>StormIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Vista</string>
|
<string>Vista</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Vista</string>
|
<string>Vista</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>VistaIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>name</key>
|
<key>name</key>
|
||||||
<string>Winter</string>
|
<string>Winter</string>
|
||||||
<key>imageName</key>
|
<key>imageName</key>
|
||||||
<string>Winter</string>
|
<string>Winter</string>
|
||||||
|
<key>iconName</key>
|
||||||
|
<string>WinterIcon</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
BIN
AltStore/Resources/Icons.xcassets/Classic/App.imageset/App.png
vendored
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
12
AltStore/Resources/Icons.xcassets/Classic/App.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "1024.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
6
AltStore/Resources/Icons.xcassets/Classic/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Blue.imageset/Blue.png
vendored
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Blue.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Blue.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 313 KiB After Width: | Height: | Size: 313 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Dark.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Dark.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Dark.imageset/Dark.png
vendored
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Honeydew.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Honeydew.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Honeydew.imageset/Honeydew.png
vendored
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 373 KiB After Width: | Height: | Size: 373 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Pride.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Pride.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Pride.imageset/Pride.png
vendored
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 719 KiB After Width: | Height: | Size: 719 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Sandy.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Sandy.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Sandy.imageset/Sandy.png
vendored
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 352 KiB After Width: | Height: | Size: 352 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Sky.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Sky.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Sky.imageset/Sky.png
vendored
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Snow.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Snow.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Snow.imageset/Snow.png
vendored
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 453 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Starburst.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Starburst.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Starburst.imageset/Starburst.png
vendored
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 181 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Storm.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Storm.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Storm.imageset/Storm.png
vendored
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 464 KiB |
12
AltStore/Resources/Icons.xcassets/Modern/Vista.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Vista.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Vista.imageset/Vista.png
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
12
AltStore/Resources/Icons.xcassets/Modern/Winter.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Winter.png",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
AltStore/Resources/Icons.xcassets/Modern/Winter.imageset/Winter.png
vendored
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
@@ -20,15 +20,17 @@ extension UIApplication
|
|||||||
|
|
||||||
private final class AltIcon: Decodable
|
private final class AltIcon: Decodable
|
||||||
{
|
{
|
||||||
static let defaultIconName: String = "AppIcon"
|
static let defaultName: String = "Original"
|
||||||
|
|
||||||
var name: String
|
var name: String
|
||||||
var imageName: String
|
var imageName: String
|
||||||
|
var iconName: String
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey
|
private enum CodingKeys: String, CodingKey
|
||||||
{
|
{
|
||||||
case name
|
case name
|
||||||
case imageName
|
case imageName
|
||||||
|
case iconName
|
||||||
}
|
}
|
||||||
|
|
||||||
required init(from decoder: Decoder) throws
|
required init(from decoder: Decoder) throws
|
||||||
@@ -36,6 +38,7 @@ private final class AltIcon: Decodable
|
|||||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
self.name = try container.decode(String.self, forKey: .name)
|
self.name = try container.decode(String.self, forKey: .name)
|
||||||
self.imageName = try container.decode(String.self, forKey: .imageName)
|
self.imageName = try container.decode(String.self, forKey: .imageName)
|
||||||
|
self.iconName = try container.decode(String.self, forKey: .iconName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,20 +149,14 @@ private extension AltAppIconsViewController
|
|||||||
config.textProperties.font = font
|
config.textProperties.font = font
|
||||||
config.textProperties.color = .label
|
config.textProperties.color = .label
|
||||||
|
|
||||||
// we have to do this hardcodded name hack for .appiconset
|
let image = UIImage(named: icon.imageName)
|
||||||
// else one can supply the artifacts via .imageset
|
|
||||||
let image: UIImage? =
|
|
||||||
UIImage(named: "\(icon.imageName)76x76@2x~ipad") ??
|
|
||||||
UIImage(named: "\(icon.imageName)60x60@2x") ??
|
|
||||||
UIImage(named: icon.imageName)
|
|
||||||
|
|
||||||
config.image = image
|
config.image = image
|
||||||
config.imageProperties.maximumSize = CGSize(width: imageWidth, height: imageWidth)
|
config.imageProperties.maximumSize = CGSize(width: imageWidth, height: imageWidth)
|
||||||
config.imageProperties.cornerRadius = imageWidth / 5.0 // Copied from AppIconImageView
|
config.imageProperties.cornerRadius = imageWidth / 5.0 // Copied from AppIconImageView
|
||||||
|
|
||||||
cell.contentConfiguration = config
|
cell.contentConfiguration = config
|
||||||
|
|
||||||
if UIApplication.shared.alternateIconName == icon.imageName || (UIApplication.shared.alternateIconName == nil && icon.imageName == AltIcon.defaultIconName)
|
if UIApplication.shared.alternateIconName == icon.iconName || (UIApplication.shared.alternateIconName == nil && icon.name == AltIcon.defaultName)
|
||||||
{
|
{
|
||||||
cell.accessories = [.checkmark(options: .init(tintColor: .white))]
|
cell.accessories = [.checkmark(options: .init(tintColor: .white))]
|
||||||
}
|
}
|
||||||
@@ -167,7 +164,7 @@ private extension AltAppIconsViewController
|
|||||||
{
|
{
|
||||||
cell.accessories = []
|
cell.accessories = []
|
||||||
}
|
}
|
||||||
|
|
||||||
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell()
|
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell()
|
||||||
backgroundConfiguration.backgroundColorTransformer = UIConfigurationColorTransformer { [weak cell] c in
|
backgroundConfiguration.backgroundColorTransformer = UIConfigurationColorTransformer { [weak cell] c in
|
||||||
if let state = cell?.configurationState, state.isHighlighted
|
if let state = cell?.configurationState, state.isHighlighted
|
||||||
@@ -205,8 +202,8 @@ extension AltAppIconsViewController
|
|||||||
collectionView.reloadData()
|
collectionView.reloadData()
|
||||||
|
|
||||||
// If assigning primary icon, pass "nil" as alternate icon name.
|
// If assigning primary icon, pass "nil" as alternate icon name.
|
||||||
let imageName = (icon.imageName == "AppIcon") ? nil : icon.imageName
|
let iconName = (icon.name == AltIcon.defaultName) ? nil : icon.iconName
|
||||||
UIApplication.shared.setAlternateIconName(imageName) { error in
|
UIApplication.shared.setAlternateIconName(iconName) { error in
|
||||||
if let error
|
if let error
|
||||||
{
|
{
|
||||||
let alertController = UIAlertController(title: NSLocalizedString("Unable to Change App Icon", comment: ""),
|
let alertController = UIAlertController(title: NSLocalizedString("Unable to Change App Icon", comment: ""),
|
||||||
|
|||||||