Questions tagged [photosui]

14 questions
6
votes
3 answers

How to call PHPhotoLibrary presentLimitedLibraryPicker from SwiftUI?

What would be the correct way of calling PHPhotoLibrary's presentLimitedLibraryPicker method from SwiftUI? The method requires a UIViewController, which I don't have in SwiftUI. I have tried to use UIViewControllerRepresentable in order to create a…
flainez
  • 11,797
  • 1
  • 18
  • 16
4
votes
1 answer

Is there a way to make PhotosPicker in SwiftUI use the camera instead?

Is there a way to make the PhotosUI PhotosPicker in SwiftUI source the photos directly from the Camera? I'm trying to change the PhotosPickers in my app to use the camera instead of forcing the user to select images from their image library. Is…
2
votes
1 answer

Adding multiple images into a view from photo library - SwiftUI

I want to add images from phone's photo library into a collage layout that I made. First I made the collage layout as a separate view in SwiftUI called CollageLayoutOne. import SwiftUI struct CollageLayoutOne: View { var uiImageOne:…
user1207524
  • 251
  • 2
  • 12
  • 27
2
votes
0 answers

Show picker view with user selected photos only

iOS 14 introduced the new PHPicker where users can select which photos the app is allowed to access the assets. How can I present the picker view with only the allowed photos visible.
jfredsilva
  • 1,434
  • 1
  • 9
  • 15
1
vote
2 answers

Stored properties with @available is not possible

I want to use a feature that is only available in >= iOS 16 therfore I use the @available flag but it does not work because "Stored properties cannot be marked potentially unavailable with '@available'" @available(iOS 16.0, *) @State private var…
Java
  • 323
  • 3
  • 15
1
vote
3 answers

iOS 14: PHPickerViewController is there any way to load all assets at the same time PHPickerResult

Currently, I am trying to dive into PHPickerViewController for select multiple image at same time from Photos. so I want to array of image that selected by user, i tried it too many way but no luck. This is my code please tell me there is an best…
1
vote
0 answers

Change default title of right bar button in PHPickerViewController

I'm implementing the new iOS 14 image picker PHPickerViewController. By default the right bar button has the title "Add". I want to change this to "Stamp". I tried the code below but it did not work. Does anyone know how to change the right bar…
chickenparm
  • 1,570
  • 1
  • 16
  • 36
0
votes
0 answers

How to Instantiate AVCapturePhotoSettings( format: [string:string] )

I tried various ways to attempt to instantiate the class: AVCapturePhotoSettings to capture images in lossless BGRA format as listed below: let settings = AVCapturePhotoSettings(format: [ kCVPixelBufferPixelFormatTypeKey : "BGRA"] ) let…
Stephen
  • 191
  • 2
  • 7
0
votes
2 answers

How to deselect a photo after re-opening the photo library?

I'm using PHPicker to handle multiple image selections. When a user initially selects, for example, 3 images from the photo library, they can re-open the photo library and deselect any of the selected photos. But I'm not sure how to handle the…
lex
  • 113
  • 8
0
votes
0 answers

How to make camera output the same binding variable as PhotosPicker output?

I want users to be able to take a photo with the camera or select a photo from their photo library. Once they select an image I want to take them to an edit view with that captured Image. The photo library flow works great because I am able to…
matt w
  • 1
  • 1
0
votes
1 answer

How to carry an Image Picker selection to another view?

I have a camera view where users can either take a photo with their camera (which opens with the view) or click the photo library icon and select an image from their library. If they take the photo right then, I am able to bind capturedImage to…
amelia
  • 71
  • 2
  • 7
0
votes
1 answer

How to select multiple photos using swiftUI and show that selected photos in the screen?

My app is crashing after adding multiple photos: import SwiftUI import PhotosUI import CoreTransferable struct ContentView: View { @State var imageData: Data? @State var selectedItems: [PhotosPickerItem] = [] var body: some…
0
votes
1 answer

Is it possible to limit the video duration when selecting a video using `PHPickerViewController`?

Im attempting to select assets using PHPickerViewController as a replacement for my UIImagePickerController, however when setting the filter and config options Im not seeing a way to set a limit on the length of video that is returned. i.e. the way…
-2
votes
1 answer

How to get path of images with IOS 16 image picker SwiftUI

Good day, How do I get the path of images from the ios 16 Photos Picker(PhotosUI Library) as I am trying to store the path in a json file to retrieve later to display I have a form with a image picker and I want to store the path in json file and…