From 65a281d9821f877017eefc0fa0d1fd3e2530623d Mon Sep 17 00:00:00 2001 From: breadone Date: Tue, 9 Jul 2024 19:28:29 +1200 Subject: [PATCH] improved launch time by not having to make any ui images --- JustScanIt/View/ScanItemView.swift | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/JustScanIt/View/ScanItemView.swift b/JustScanIt/View/ScanItemView.swift index e26c7bb..546339d 100644 --- a/JustScanIt/View/ScanItemView.swift +++ b/JustScanIt/View/ScanItemView.swift @@ -15,7 +15,7 @@ struct ScanItemView: View { let scan: Scan let images: [Image] - let uiImages: [UIImage] +// let uiImages: [UIImage] private let translucentColour = Color(red: 0.6, green: 0.8, blue: 1, opacity: 0.4) @@ -25,7 +25,7 @@ struct ScanItemView: View { init(_ scan: Scan) { self.scan = scan self.images = scan.toSwiftUIImages() - self.uiImages = scan.toUIImages() +// self.uiImages = scan.toUIImages() } var body: some View { @@ -91,8 +91,9 @@ struct ScanItemView: View { if isZoomed { TabView { - ForEach(self.uiImages, id: \.self) { img in - Image(uiImage: img) + ForEach(self.images, id: \.self) { img in +// Image(uiImage: img) + img .resizable() .scaledToFit() .frame(maxHeight: 400) @@ -145,3 +146,10 @@ struct ScanItemView: View { .navigationTitle("Just Scan It!") } } + +extension Image: Hashable { + public func hash(into hasher: inout Hasher) { + + } + +}