Added support for content types PNG in the DocumentView view for the Browse module.
This commit is contained in:
parent
dc00fa66cb
commit
b77f1b758c
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user