Skip to content

bug: 업로드, 프로필 편집시 PHPicker 이전에 선택한 것 reset #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 CodeBomber. All rights reserved.
//


import UIKit
import PhotosUI
import OSLog
Expand All @@ -23,7 +22,7 @@ final class EditProfileViewController: BaseViewController {
// MARK: - UI Components

private lazy var phPickerViewController: PHPickerViewController = {
var configuration = PHPickerConfiguration()
var configuration = PHPickerConfiguration(photoLibrary: PHPhotoLibrary.shared())
configuration.filter = .images
configuration.selectionLimit = 1
let phPickerViewController = PHPickerViewController(configuration: configuration)
Expand Down Expand Up @@ -263,6 +262,7 @@ extension EditProfileViewController: PHPickerViewControllerDelegate {
}
}.resume()
}
picker.deselectAssets(withIdentifiers: results.compactMap(\.assetIdentifier))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class VideoPickerManager: NSObject, PHPickerViewControllerDelegate {
weak var videoPickerDelegate: VideoPickerDelegate?

let phPickerViewController: PHPickerViewController = {
var configuration = PHPickerConfiguration()
var configuration = PHPickerConfiguration(photoLibrary: PHPhotoLibrary.shared())
configuration.preferredAssetRepresentationMode = .current
configuration.filter = .videos
configuration.selectionLimit = 1
Expand All @@ -41,7 +41,6 @@ final class VideoPickerManager: NSObject, PHPickerViewControllerDelegate {
self.phPickerViewController.dismiss(animated: true)
return
}

_ = result.itemProvider.loadFileRepresentation(forTypeIdentifier: UTType.movie.identifier) { url, error in
if error != nil {
Task {
Expand All @@ -55,6 +54,7 @@ final class VideoPickerManager: NSObject, PHPickerViewControllerDelegate {
self.videoPickerDelegate?.didFinishPickingVideo(url)
}
}
picker.deselectAssets(withIdentifiers: results.compactMap(\.assetIdentifier))
}

}