This commit is contained in:
Max Hunt 2019-07-23 19:39:01 +01:00
parent 6217be1924
commit a6cd8e309a
33 changed files with 77 additions and 20 deletions

View File

@ -1,28 +1,16 @@
{
"images" : [
{
{
"size" : "20x20",
"idiom": "iphone",
"filename" : "appLogo-20@2x.png",
"scale": "2x"
},
{
"size" : "20x20",
"idiom": "iphone",
"filename" : "appLogo-20@3x.png",
"scale": "3x"
},
{
"size" : "20x20",
"idiom": "ipad",
"filename" : "appLogo-20.png",
"scale": "1x"
"idiom" : "iphone",
"filename" : "appLogo-20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom": "ipad",
"filename" : "appLogo-20@2x.png",
"scale": "2x"
"idiom" : "iphone",
"filename" : "appLogo-20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
@ -60,6 +48,18 @@
"filename" : "appLogo-60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "appLogo-20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "appLogo-20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1486,6 +1486,22 @@ And thats all you need to know to follow the vibe!</string>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="DO NOT PRESS"/>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YeQ-WQ-n1K">
<rect key="frame" x="89" y="215" width="33" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Dark"/>
<connections>
<action selector="darkBtnPressed:" destination="FXb-No-u4u" eventType="touchUpInside" id="20Q-Y4-vVN"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IyG-gq-Bc5">
<rect key="frame" x="191" y="215" width="35" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Light"/>
<connections>
<action selector="lightBtnPresssed:" destination="FXb-No-u4u" eventType="touchUpInside" id="4bu-yi-N7Q"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="3YM-pK-9CO"/>

View File

@ -37,6 +37,29 @@ class SecretsViewController: UIViewController {
}
@IBAction func darkBtnPressed(_ sender: Any) {
if UIApplication.shared.supportsAlternateIcons {
if let alternateIconName = UIApplication.shared.alternateIconName {
print("current icon is \(alternateIconName), change to primary icon")
UIApplication.shared.setAlternateIconName(nil)
} else {
print("current icon is primary icon, change to alternative icon")
UIApplication.shared.setAlternateIconName("ad"){ error in
if let error = error {
print(error.localizedDescription)
} else {
print("Done!")
}
}
}
}
}
@IBAction func lightBtnPresssed(_ sender: Any) {
changeIcon(to: "appLogo-60")
}
@IBAction func easterBtnPressed(_ sender: Any) {
UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green})
@ -71,6 +94,24 @@ class SecretsViewController: UIViewController {
}
func changeIcon(to iconName: String) {
// 1
guard UIApplication.shared.supportsAlternateIcons else {
return
}
// 2
UIApplication.shared.setAlternateIconName(iconName, completionHandler: { (error) in
// 3
if let error = error {
print("App icon failed to change due to \(error.localizedDescription)")
} else {
print("App icon changed successfully")
}
})
}
// defaults.set(0, forKey: "setupDone")
}