From 6743602be5fc443a1554c15342c8dcd501229b5d Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Thu, 15 Dec 2022 14:45:20 +0200 Subject: [PATCH] [Oztechan/CCC#1441] Enable iOS SwiftUI Previews --- ios/CCC/UI/Slider/SlideView.swift | 19 ++++++++++++++++--- res/build.gradle.kts | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ios/CCC/UI/Slider/SlideView.swift b/ios/CCC/UI/Slider/SlideView.swift index 5bc654749d..4992d40769 100644 --- a/ios/CCC/UI/Slider/SlideView.swift +++ b/ios/CCC/UI/Slider/SlideView.swift @@ -21,7 +21,7 @@ struct SlideView: View { var body: some View { ZStack { - Color(MR.colors().background_strong.get()).edgesIgnoringSafeArea(.all) +// Color(MR.colors().background_strong.get()).edgesIgnoringSafeArea(.all) VStack { Spacer() @@ -32,7 +32,7 @@ struct SlideView: View { image .resize(widthAndHeight: 144.cp()) - .accentColor(MR.colors().text.get()) +// .accentColor(MR.colors().text.get()) .padding(4.cp()) Text(subTitle1) @@ -60,7 +60,7 @@ struct SlideView: View { label: { Text(buttonText) .font(relative: .body) - .foregroundColor(MR.colors().text.get()) +// .foregroundColor(MR.colors().text.get()) } ).padding(top: 10.cp(), leading: 10.cp(), bottom: 15.cp(), trailing: 15.cp()) } @@ -68,3 +68,16 @@ struct SlideView: View { } } } + +struct SlideViewPreviews: PreviewProvider { + static var previews: some View { + SlideView( + title: "Test Title", + image: Image(systemName: "gear"), + subTitle1: "Subtitle 1", + subTitle2: "Subtitle 2", + buttonText: "Button", + buttonAction: {} + ) + } +} diff --git a/res/build.gradle.kts b/res/build.gradle.kts index 35d5ad320e..2d838742f8 100644 --- a/res/build.gradle.kts +++ b/res/build.gradle.kts @@ -24,6 +24,7 @@ kotlin { } framework { baseName = Modules.RES.frameworkName + isStatic = true } }