From 26442aea763bbd7cdfee46d57f1bf1b0b80315fc Mon Sep 17 00:00:00 2001 From: hengyu Date: Tue, 5 Dec 2023 18:00:25 +0800 Subject: [PATCH] Remove Swift version check --- Sources/FeedbackSwift/Bundle+Extensions.swift | 2 +- Sources/FeedbackSwift/Functions.swift | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Sources/FeedbackSwift/Bundle+Extensions.swift b/Sources/FeedbackSwift/Bundle+Extensions.swift index 624607b..a8ecd46 100644 --- a/Sources/FeedbackSwift/Bundle+Extensions.swift +++ b/Sources/FeedbackSwift/Bundle+Extensions.swift @@ -18,7 +18,7 @@ extension Bundle { } static var platformNamesPlistPath: String? { - #if SWIFT_PACKAGE && swift(>=5.3) + #if SWIFT_PACKAGE let bundles: [Bundle] = [Bundle.main, Bundle.feedbackBundle, Bundle.module] #else let bundles: [Bundle] = [Bundle.main, Bundle.feedbackBundle] diff --git a/Sources/FeedbackSwift/Functions.swift b/Sources/FeedbackSwift/Functions.swift index 02e9bb8..4f2fc77 100644 --- a/Sources/FeedbackSwift/Functions.swift +++ b/Sources/FeedbackSwift/Functions.swift @@ -3,12 +3,13 @@ // Copyright (c) 2017 CAPH TECH. All rights reserved. // -import UIKit -import MobileCoreServices import AVFoundation +import MobileCoreServices +import UIKit +import UniformTypeIdentifiers func localized(_ key: String) -> String { - #if SWIFT_PACKAGE && swift(>=5.3) + #if SWIFT_PACKAGE let bundles: [Bundle] = [Bundle.main, Bundle.feedbackBundle, Bundle.module] #else let bundles: [Bundle] = [Bundle.main, Bundle.feedbackBundle] @@ -27,15 +28,8 @@ func localized(_ key: String) -> String { } func getMediaFromImagePickerInfo(_ info: [UIImagePickerController.InfoKey: Any]) async -> Media? { - let imageType: String - let movieType: String - if #available(iOS 14.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *) { - imageType = UTType.image.identifier - movieType = UTType.movie.identifier - } else { - imageType = kUTTypeImage as String - movieType = kUTTypeMovie as String - } + let imageType = UTType.image.identifier + let movieType = UTType.movie.identifier switch info[.mediaType] as? String { case imageType?: