Commit adbdfc1e authored by Martin's avatar Martin
Browse files

IOS-2437 - remove comments and add @available annotation

parent 0d89a68a
......@@ -69,12 +69,14 @@ class MediaAttachmentPickerProviderViewModel {
/// - Parameters:
/// - url: The url of the image
/// - image: The image itself
@available(iOS 14, *)
public func handleDidFinishPickingImage(url: URL, image: UIImage) {
createImageAttchmentAndInformResultDelegate(url: url, image: image)
}
/// Handle the video selection
/// - Parameter url: The url of the resource
@available(iOS 14, *)
public func handleDidFinishPickingVideoAt(url: URL) {
// We got something from picker that is not an image. Probalby video/movie.
createMovieAttchmentAndInformResultDelegate(url: url)
......@@ -98,8 +100,7 @@ extension MediaAttachmentPickerProviderViewModel {
extension MediaAttachmentPickerProviderViewModel {
// iOS version greater than iOS14
@available(iOS 14, *)
private func createMovieAttchmentAndInformResultDelegate(url: URL) {
createAttachment(forResource: url, session: session) {[weak self] (attachment) in
guard let me = self else {
......@@ -117,6 +118,7 @@ extension MediaAttachmentPickerProviderViewModel {
}
}
@available(iOS 14, *)
private func createImageAttchmentAndInformResultDelegate(url: URL, image: UIImage) {
var attachment: Attachment!
session.performAndWait {[weak self] in
......@@ -150,8 +152,6 @@ extension MediaAttachmentPickerProviderViewModel {
}
}
// iOS version lower than iOS14
private func createImageAttchmentAndInformResultDelegate(info: [UIImagePickerController.InfoKey: Any]) {
guard
let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment