Post

Replies

Boosts

Views

Created

NSItemProvider make .jpg image to .jpeg
Hi, I'm not sure why but when my fileURL is .jpg file and I drop the file from my app to Finder folders it make the dropped file as .jpeg Is there a way to fix it? [.onDrag { if FileManager.default.fileExists(atPath: file.path) { // Provide the file as an item for dragging let fileURL = URL(fileURLWithPath: file.path) let itemProvider = NSItemProvider(contentsOf: fileURL) // Remove the file extension in the suggestedName let baseNameWithoutExtension = fileURL.deletingPathExtension().lastPathComponent itemProvider?.suggestedName = baseNameWithoutExtension return itemProvider ?? NSItemProvider() } else { // Handle the case where the file no longer exists print("File no longer exists at path: \(file.path)") return NSItemProvider() } })
0
0
358
Dec ’24
Rectangle change size by swipe
Hi,, How can I make a rectangle become taller as I swipe down on my trackpad?" struct BlueRectangleView: View { var body: some View { VStack { Rectangle() .fill(Color.blue) .frame(width: 200, height: 100) .cornerRadius(10) .shadow(radius: 5) .padding() } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.white) } } struct BlueRectangleView_Previews: PreviewProvider { static var previews: some View { BlueRectangleView() } }
2
0
277
Jan ’25