With Swift 5.5 and XCode 13.1 it complains about the Image not being the proper type
Cannot convert value of type âBinding<Image?>â to expected argument type âBinding<UIImage?>â
Updating the image binding to UIImage? fixes it but following the tutorial later makes everything not work any more.
Actually, I copied the code from Version 3 in Github and is working again.
@lancy98@chargio Hi! Sorry about that. As @chargio mentioned, the Version 3 branch is the one you should be using, but we failed to update that to be the default branch before publishing the course.
Iâve updated the repo so it should point you to the most recent materials, now. :]
Hello @catie, Thank you for the reply. I was using version 2. Now that I downloaded version 3 - I can still see the same issue when running the project under the final folder.
There are two issues that I see when running the project under XCode 13.1
Bunch of constraint warnings when running the project in the console.
The image that I select in the picker does not display in the app. The console prints out the below log
2021-11-19 11:03:54.807985+1300 ReadMe[48417:7625491] [claims] Upload preparation for claim F4747C0A-2E72-49CB-88AD-DA55CBE7C312 completed with error: Error Domain=NSCocoaErrorDomain Code=260 âThe file âversion=1&uuid=CC95F08C-88C3-4012-9D6D-64A413D254B3&mode=compatible.jpegâ couldnât be opened because there is no such file.â UserInfo={NSURL=file:///Users/user/Library/Developer/CoreSimulator/Devices/862B79EA-FE48-46FC-924D-DBC55465E018/data/Containers/Shared/AppGroup/6C94D220-5744-4B5B-813D-CF5680B9F3E7/File%20Provider%20Storage/photospicker/version=1&uuid=CC95F08C-88C3-4012-9D6D-64A413D254B3&mode=compatible.jpeg, NSFilePath=/Users/user/Library/Developer/CoreSimulator/Devices/862B79EA-FE48-46FC-924D-DBC55465E018/data/Containers/Shared/AppGroup/6C94D220-5744-4B5B-813D-CF5680B9F3E7/File Provider Storage/photospicker/version=1&uuid=CC95F08C-88C3-4012-9D6D-64A413D254B3&mode=compatible.jpeg, NSUnderlyingError=0x600003f913b0 {Error Domain=NSPOSIXErrorDomain Code=2 âNo such file or directoryâ}}
1 - The constraint warnings are lingering SwiftUI bugs that you can safely ignore. Theyâre referencing UIKit constraints, which we canât really do anything about when working with SwiftUI. Hopefully Apple will handle these in the future!
2 - The pink flower image is missing from the simulators. If you select any other image, it should work. I am sorry for not calling this out in the video itself, because itâs a bug thatâs been around for a while, now, that you will run into anytime youâre using the photo picker. If you dig to find the missing file referenced in the console, youâll see there is a matching .heic file there, but not the .jpeg itâs looking for. And the .heic file is empty!
It still shows up in the simulatorâs Photos library because there is a valid thumbnail file hanging around in:
Library/CoreSimulator/Devices/[ENTER DEVICE ID HERE]/data/Media/PhotoData/Thumbnails/V2/DCIM/100APPLE/IMG_0006.HEIC