diff --git a/Modules/Sources/Browse/UI/Views/DocumentView.swift b/Modules/Sources/Browse/UI/Views/DocumentView.swift index 8a4e5e8..0fe9294 100644 --- a/Modules/Sources/Browse/UI/Views/DocumentView.swift +++ b/Modules/Sources/Browse/UI/Views/DocumentView.swift @@ -100,6 +100,10 @@ private extension DocumentView { // MARK: Computed + var supportedContentTypes: [String] { + [.ContentType.jpeg, .ContentType.png] + } + var imageFromData: UIImage { guard let loadedData, @@ -114,7 +118,7 @@ private extension DocumentView { // MARK: Functions func loadDataIfPossible() async { - guard document.contentType == .Constants.supportedContentType else { + guard supportedContentTypes.contains(document.contentType) else { status = .notSupported return } @@ -147,8 +151,9 @@ private extension DocumentView { // MARK: - String+Constants private extension String { - enum Constants { - static let supportedContentType = "image/jpeg" + enum ContentType { + static let jpeg = "image/jpeg" + static let png = "image/png" } }