Relative Content

Tag Archive for iosswiftswiftuiphotospicker

SwiftUI PhotosPicker – get the size of picked item in Kilobytes

var body: some View { PhotosPicker(selection: $selectedItem, matching: .any(of: [.images, .videos]), photoLibrary: .shared()){ Image(systemName: “camera.fill”) .resizable() .aspectRatio(contentMode: .fit) .frame(height: 20) .padding(2) } .onChange(of: selectedItem) { newItem in // item size in kilobytes? } } Is there a way to get the size of selectedItem in Kilobytes? I know how to do it by finding out […]