mirror of
https://github.com/Mueller-Patrick/DHBW-Service-App.git
synced 2026-04-28 18:30:09 +00:00
🥚 Added 2nd app icon as easter egg
This commit is contained in:
@@ -44,5 +44,29 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>dhbw-standard-icon</string>
|
||||
</array>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>CFBundleAlternateIcons</key>
|
||||
<dict>
|
||||
<key>Alpaca-Alt-Icon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>alpaca-alt-icon</string>
|
||||
</array>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -50,6 +50,7 @@ struct FirstOpeningSettings: View {
|
||||
|
||||
Button(action: {
|
||||
self.saveToCoreData()
|
||||
self.checkAppIcon()
|
||||
}){
|
||||
Text("Confirm")
|
||||
.padding()
|
||||
@@ -103,6 +104,32 @@ extension FirstOpeningSettings{
|
||||
self.settings.isFirstOpening = !self.settings.isFirstOpening
|
||||
PersistenceController.shared.save()
|
||||
}
|
||||
|
||||
/*
|
||||
Check the input and change app icon if necessary
|
||||
*/
|
||||
func checkAppIcon() {
|
||||
if(self.name.lowercased().contains("alpaca")) {
|
||||
UIApplication.shared.setAlternateIconName("Alpaca-Alt-Icon") { error in
|
||||
if let error = error {
|
||||
print("Error changing app icon:")
|
||||
print(error.localizedDescription)
|
||||
} else {
|
||||
print("Successfully changed app icon!")
|
||||
}
|
||||
}
|
||||
}
|
||||
if(UIApplication.shared.alternateIconName == "Alpaca-Alt-Icon" && !self.name.lowercased().contains("alpaca")) {
|
||||
UIApplication.shared.setAlternateIconName(nil) { error in
|
||||
if let error = error {
|
||||
print("Error changing app icon:")
|
||||
print(error.localizedDescription)
|
||||
} else {
|
||||
print("Successfully changed app icon!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct FirstOpeningSettings_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user