Skip to content

Commit

Permalink
Merge pull request #291 from boostcampwm2023/iOS/bug#287
Browse files Browse the repository at this point in the history
bug: 업로드, 프로필 편집시 PHPicker 이전에 선택한 것 reset
  • Loading branch information
anyukyung authored Dec 11, 2023
2 parents da0f8e9 + a4ec1f1 commit 7490581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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))
}

}

0 comments on commit 7490581

Please sign in to comment.