|
Hi, everyone. Currently, I am on Milestone projects 10-12 and stuck. So, where I am:
So, when I run the app everything works fine: I can open the picker and add photos saved on my phone. When I click on the photo, the Detailviewcontroller appears, BUT... but the photo is not displayed for some reason. I have already been stuck for two days))) and somehow I know where the problem is:
Now I know that for some reason my imageView.image is left "empty". But everything that I have tried is not working. So, the question why dosn't my imageView.image work? and why while I run the app my detail view controler is not showing the image? I would be extremely grateful if someone would help me to solve the problem. |
|
Hi @Mykola! I suspect you forgot to retrieve the path. You saved the image before displaying it in DetailView so it should be something like this.
for Picture Class you can use this:
|
|
@ygeras Thanks a lot! I have tried but it still does not work. So I will share all my code with you)
Now DetailView with your suggestions:
and here is my Picture class:
I would be very appreciated if you check the code! |
|
Your mistake most probably here in DetailView
you have to pass it as
also in didSelectRowAt pass a string not an object Picture
if it doens't help let me know. Will check line by line tomorrow :) |
|
@ygeras It still does not work) Please, check it by the line tomorrow. 🙏 Have goot night!) |
|
Now cannot fall asleep )))) unless try to solve it. So let's start with ViewController Class
In DetailView basically we leave the same.
So the issues should have been also here appendingPathExtension(imageName). You added it as a file extension to save not as PathComponent. PS Before running on simulator, delete app so that all leftovers from previous app are gone. |
|
|
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.