-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
PhotoPicker not binding data #51
Comments
This is extremely unclear. I have no idea what you're suggesting or referencing here I'm afraid. Please add a lot more detail so I can understand the "issue"? |
How to get the corresponding Photo or Video Data through PhotoPicker, there is no corresponding data binding here |
I see, in your first comment you referenced internal details which is not relevant to your question. The original API is completion based, so obvs you don't see the binding being setup there. But also that's internal and you cannot use that anyway. Rather you want to use the modifier on your SwiftUI view similar to the following: struct PhotosSelector: View {
@State var selectedItems: [PhotosPickerItem] = []
var body: some View {
Backport.PhotosPicker(
selection: $selectedItems,
matching: .images
) {
Text("Select Multiple Photos")
}
}
} You can also use
|
struct PhotosDemoView: View {
} selection is no changes, is not work |
I guess the photo data selected by PHPickerViewController is not binding to PhotosPickerItem |
Hmmm this was implemented some time ago, I'm kinda surprised if this isn't working and it's only being reported now. I guess no one is using it, but I'm not 100%. I'll need to re-test and work out what's going on – but I do not have time atm so this may take a couple weeks I'm afraid. |
@jackiehu can you confirm what iOS version you're testing against? There are 2 implementations included, one for iOS 13 and the other for iOS 14+ |
Ouch, I apologise but I think a WIP was accidentally merged into main and then released prematurely. I will pull this immediately as this is not at all complete. All the API pieces are there, but a lot of the implementation still has I will need to revisit this and re-release at a later date, I'm sorry I have no idea how this happened. My bad 🤦♂️ EDIT: I've now pushed a new release that removes/cleans this up for now. I will try and complete this asap and get it into an upcoming release, sorry about that. |
@shaps80 Hi Shaps, will we see new update for PhotosPicker soon ? |
Not at least for a couple of weeks. I'm working 2 other contracts atm and then next week I'm on holiday for a week. So Sep is the earliest I'll have a chance to revisit this sorry. |
My copy,and use now |
No problem, take your time
Awesome, I tried it it working find with a little bit of change to my code to support version below iOS 16 |
PhotoPicker not binding data
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
isPresented.wrappedValue = false
}
The text was updated successfully, but these errors were encountered: