🥚 Added 2nd app icon as easter egg

This commit is contained in:
Patrick Müller 2021-01-08 11:30:07 +01:00 committed by Patrick Müller
parent 6419e5ca1a
commit 81f9e8706c
7 changed files with 99 additions and 2 deletions

View File

@ -7,6 +7,10 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
CD2FC0C525A869FE00963178 /* dhbw-standard-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2FC0C025A869FE00963178 /* dhbw-standard-icon@2x.png */; };
CD2FC0C625A869FE00963178 /* dhbw-standard-icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2FC0C125A869FE00963178 /* dhbw-standard-icon@3x.png */; };
CD2FC0C725A869FE00963178 /* alpaca-alt-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2FC0C325A869FE00963178 /* alpaca-alt-icon@2x.png */; };
CD2FC0C825A869FE00963178 /* alpaca-alt-icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2FC0C425A869FE00963178 /* alpaca-alt-icon@3x.png */; };
CD730A35259A860E00E0BB69 /* SettingsAcknowledgements.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD730A34259A860E00E0BB69 /* SettingsAcknowledgements.swift */; }; CD730A35259A860E00E0BB69 /* SettingsAcknowledgements.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD730A34259A860E00E0BB69 /* SettingsAcknowledgements.swift */; };
CD9FAB81258EC60200D6D0C5 /* DHBW_ServiceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9FAB80258EC60200D6D0C5 /* DHBW_ServiceApp.swift */; }; CD9FAB81258EC60200D6D0C5 /* DHBW_ServiceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9FAB80258EC60200D6D0C5 /* DHBW_ServiceApp.swift */; };
CD9FAB83258EC60200D6D0C5 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9FAB82258EC60200D6D0C5 /* ContentView.swift */; }; CD9FAB83258EC60200D6D0C5 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9FAB82258EC60200D6D0C5 /* ContentView.swift */; };
@ -44,6 +48,10 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
CD2FC0C025A869FE00963178 /* dhbw-standard-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dhbw-standard-icon@2x.png"; sourceTree = "<group>"; };
CD2FC0C125A869FE00963178 /* dhbw-standard-icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dhbw-standard-icon@3x.png"; sourceTree = "<group>"; };
CD2FC0C325A869FE00963178 /* alpaca-alt-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alpaca-alt-icon@2x.png"; sourceTree = "<group>"; };
CD2FC0C425A869FE00963178 /* alpaca-alt-icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "alpaca-alt-icon@3x.png"; sourceTree = "<group>"; };
CD730A34259A860E00E0BB69 /* SettingsAcknowledgements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsAcknowledgements.swift; sourceTree = "<group>"; }; CD730A34259A860E00E0BB69 /* SettingsAcknowledgements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsAcknowledgements.swift; sourceTree = "<group>"; };
CD9FAB7D258EC60200D6D0C5 /* DHBW-Service.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DHBW-Service.app"; sourceTree = BUILT_PRODUCTS_DIR; }; CD9FAB7D258EC60200D6D0C5 /* DHBW-Service.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DHBW-Service.app"; sourceTree = BUILT_PRODUCTS_DIR; };
CD9FAB80258EC60200D6D0C5 /* DHBW_ServiceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DHBW_ServiceApp.swift; sourceTree = "<group>"; }; CD9FAB80258EC60200D6D0C5 /* DHBW_ServiceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DHBW_ServiceApp.swift; sourceTree = "<group>"; };
@ -96,6 +104,41 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
CD2FC0BD25A869F000963178 /* res */ = {
isa = PBXGroup;
children = (
CD2FC0BE25A869FE00963178 /* Icons */,
);
path = res;
sourceTree = "<group>";
};
CD2FC0BE25A869FE00963178 /* Icons */ = {
isa = PBXGroup;
children = (
CD2FC0BF25A869FE00963178 /* Standard */,
CD2FC0C225A869FE00963178 /* Alt1 */,
);
path = Icons;
sourceTree = "<group>";
};
CD2FC0BF25A869FE00963178 /* Standard */ = {
isa = PBXGroup;
children = (
CD2FC0C025A869FE00963178 /* dhbw-standard-icon@2x.png */,
CD2FC0C125A869FE00963178 /* dhbw-standard-icon@3x.png */,
);
path = Standard;
sourceTree = "<group>";
};
CD2FC0C225A869FE00963178 /* Alt1 */ = {
isa = PBXGroup;
children = (
CD2FC0C325A869FE00963178 /* alpaca-alt-icon@2x.png */,
CD2FC0C425A869FE00963178 /* alpaca-alt-icon@3x.png */,
);
path = Alt1;
sourceTree = "<group>";
};
CD730A33259A85F500E0BB69 /* SettingsSubViews */ = { CD730A33259A85F500E0BB69 /* SettingsSubViews */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -194,6 +237,7 @@
CDCD721225912D6300FBF2F5 /* Supporting Files */ = { CDCD721225912D6300FBF2F5 /* Supporting Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CD2FC0BD25A869F000963178 /* res */,
CDDCF482259202700027CDC5 /* l10n */, CDDCF482259202700027CDC5 /* l10n */,
CD9FAB8E258EC60600D6D0C5 /* Info.plist */, CD9FAB8E258EC60600D6D0C5 /* Info.plist */,
CD9FAB84258EC60600D6D0C5 /* Assets.xcassets */, CD9FAB84258EC60600D6D0C5 /* Assets.xcassets */,
@ -349,10 +393,14 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
CD2FC0C725A869FE00963178 /* alpaca-alt-icon@2x.png in Resources */,
CD9FAB88258EC60600D6D0C5 /* Preview Assets.xcassets in Resources */, CD9FAB88258EC60600D6D0C5 /* Preview Assets.xcassets in Resources */,
CDDCF4A2259203B40027CDC5 /* General.strings in Resources */, CDDCF4A2259203B40027CDC5 /* General.strings in Resources */,
CD2FC0C525A869FE00963178 /* dhbw-standard-icon@2x.png in Resources */,
CD2FC0C625A869FE00963178 /* dhbw-standard-icon@3x.png in Resources */,
CDDCF493259203390027CDC5 /* Localizable.strings in Resources */, CDDCF493259203390027CDC5 /* Localizable.strings in Resources */,
CD9FAB85258EC60600D6D0C5 /* Assets.xcassets in Resources */, CD9FAB85258EC60600D6D0C5 /* Assets.xcassets in Resources */,
CD2FC0C825A869FE00963178 /* alpaca-alt-icon@3x.png in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -565,7 +613,6 @@
CD9FABA8258EC60600D6D0C5 /* Debug */ = { CD9FABA8258EC60600D6D0C5 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\"";
@ -587,7 +634,6 @@
CD9FABA9258EC60600D6D0C5 /* Release */ = { CD9FABA9258EC60600D6D0C5 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"DHBW-Service/Preview Content\"";

View File

@ -44,5 +44,29 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </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> </dict>
</plist> </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

View File

@ -50,6 +50,7 @@ struct FirstOpeningSettings: View {
Button(action: { Button(action: {
self.saveToCoreData() self.saveToCoreData()
self.checkAppIcon()
}){ }){
Text("Confirm") Text("Confirm")
.padding() .padding()
@ -103,6 +104,32 @@ extension FirstOpeningSettings{
self.settings.isFirstOpening = !self.settings.isFirstOpening self.settings.isFirstOpening = !self.settings.isFirstOpening
PersistenceController.shared.save() 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 { struct FirstOpeningSettings_Previews: PreviewProvider {