Skip to content

Commit

Permalink
Remove Swift version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Hengyu committed Dec 5, 2023
1 parent 4955e7a commit 26442ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Sources/FeedbackSwift/Bundle+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
18 changes: 6 additions & 12 deletions Sources/FeedbackSwift/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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?:
Expand Down

0 comments on commit 26442ae

Please sign in to comment.