From 876ffba417642f828b968c1200c9fd9ca4e543a9 Mon Sep 17 00:00:00 2001 From: Daniel Chick Date: Wed, 13 Mar 2024 15:37:03 -0500 Subject: [PATCH] Enable Swift Symbol Generation for Assets Catalogs (#955) --- Swiftfin tvOS/Views/BasicAppSettingsView.swift | 2 +- Swiftfin tvOS/Views/ServerListView.swift | 2 +- Swiftfin tvOS/Views/SettingsView/SettingsView.swift | 2 +- Swiftfin.xcodeproj/project.pbxproj | 4 +++- .../xcshareddata/xcschemes/Swiftfin tvOS.xcscheme | 2 +- Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin.xcscheme | 2 +- Swiftfin/Views/AboutAppView.swift | 2 +- .../Components/AboutView/Components/RatingsCard.swift | 4 ++-- Swiftfin/Views/LiveTVChannelItemWideElement.swift | 4 ++-- contributing.md | 2 +- 10 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Swiftfin tvOS/Views/BasicAppSettingsView.swift b/Swiftfin tvOS/Views/BasicAppSettingsView.swift index a3170949..0460540e 100644 --- a/Swiftfin tvOS/Views/BasicAppSettingsView.swift +++ b/Swiftfin tvOS/Views/BasicAppSettingsView.swift @@ -26,7 +26,7 @@ struct BasicAppSettingsView: View { var body: some View { SplitFormWindowView() .descriptionView { - Image("jellyfin-blob-blue") + Image(.jellyfinBlobBlue) .resizable() .aspectRatio(contentMode: .fit) .frame(maxWidth: 400) diff --git a/Swiftfin tvOS/Views/ServerListView.swift b/Swiftfin tvOS/Views/ServerListView.swift index e3f5c096..53d63ce3 100644 --- a/Swiftfin tvOS/Views/ServerListView.swift +++ b/Swiftfin tvOS/Views/ServerListView.swift @@ -75,7 +75,7 @@ struct ServerListView: View { SplitFormWindowView() .descriptionView { VStack { - Image("jellyfin-blob-blue") + Image(.jellyfinBlobBlue) .resizable() .aspectRatio(contentMode: .fit) .frame(maxWidth: 400) diff --git a/Swiftfin tvOS/Views/SettingsView/SettingsView.swift b/Swiftfin tvOS/Views/SettingsView/SettingsView.swift index d9e6b7bb..1c25df15 100644 --- a/Swiftfin tvOS/Views/SettingsView/SettingsView.swift +++ b/Swiftfin tvOS/Views/SettingsView/SettingsView.swift @@ -25,7 +25,7 @@ struct SettingsView: View { var body: some View { SplitFormWindowView() .descriptionView { - Image("jellyfin-blob-blue") + Image(.jellyfinBlobBlue) .resizable() .aspectRatio(contentMode: .fit) .frame(maxWidth: 400) diff --git a/Swiftfin.xcodeproj/project.pbxproj b/Swiftfin.xcodeproj/project.pbxproj index 7852e4dc..0c82d1ef 100644 --- a/Swiftfin.xcodeproj/project.pbxproj +++ b/Swiftfin.xcodeproj/project.pbxproj @@ -2964,7 +2964,7 @@ New, ); LastSwiftUpdateCheck = 1250; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1520; TargetAttributes = { 5358705F2669D21600D05A09 = { CreatedOnToolsVersion = 12.5; @@ -3994,6 +3994,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -4058,6 +4059,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; diff --git a/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme b/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme index ba69d8c7..ce949bc4 100644 --- a/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme +++ b/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme @@ -1,6 +1,6 @@ = 60 { - Image("tomato.fresh") + Image(.tomatoFresh) .symbolRenderingMode(.multicolor) .foregroundStyle(.green, .red) } else { - Image("tomato.rotten") + Image(.tomatoRotten) .symbolRenderingMode(.monochrome) .foregroundColor(.green) } diff --git a/Swiftfin/Views/LiveTVChannelItemWideElement.swift b/Swiftfin/Views/LiveTVChannelItemWideElement.swift index 1d637a22..4a43ce19 100644 --- a/Swiftfin/Views/LiveTVChannelItemWideElement.swift +++ b/Swiftfin/Views/LiveTVChannelItemWideElement.swift @@ -103,7 +103,7 @@ struct LiveTVChannelItemWideElement: View { programLabel( timeText: currentProgramText.timeDisplay, titleText: currentProgramText.title, - color: Color("TextHighlightColor") + color: Color(.textHighlight) ) if nextProgramsText.isNotEmpty { let nextItem = nextProgramsText[0] @@ -132,7 +132,7 @@ struct LiveTVChannelItemWideElement: View { .background { RoundedRectangle(cornerRadius: 10, style: .continuous) .fill(Color("BackgroundColor")) - .shadow(color: Color("ShadowColor"), radius: 4, x: 0, y: 0) + .shadow(color: Color(.shadow), radius: 4, x: 0, y: 0) } } diff --git a/contributing.md b/contributing.md index 417c36ed..d3a4d58d 100644 --- a/contributing.md +++ b/contributing.md @@ -6,7 +6,7 @@ ## Setup -Fork the Swiftfin repo and install the necessary dependencies with Xcode 14: +Fork the Swiftfin repo and install the necessary dependencies with Xcode 15: ```bash # install Carthage, SwiftFormat, and SwiftGen with homebrew