Great job on the explanation! The video is packed with tons of small yet meaningful details that really make a difference. Much appreciated!🥰
@StewartLynchАй бұрын
Awesome, thank you!
@predicked2 ай бұрын
Great content, Stewart! This tutorial on setting up the DataModel and View for Camera Photos in SwiftData is incredibly clear and well-structured. The step-by-step guidance made it easy to follow along, and I appreciate how you broke down the complex concepts into manageable parts. Thanks for providing such valuable content. Looking forward to other app tutorials.
@StewartLynch2 ай бұрын
Glad you found it helpful
@dmacharo6 ай бұрын
What a treat! Can't wait for the rest of the series, thanks a million Stuart!
@andrejkling38866 ай бұрын
Thank you so much Stewart 💯
@BlerdGrid6 ай бұрын
Hey Stewart, thanks for this video series! It's helping me get through a project I'm working on. I'm hitting an error that I can't figure out though. When I add the "List(samples)" closure I get a "Failed to produce diagnostic for expression" error. I removed that block of code and the error went away...so my question is, would I need to add a "if let" to unwrap the image(s)? Thanks again!
@StewartLynch6 ай бұрын
I doubt that would be the problem. Without seeing your project it is difficult to to comment on what might be causing the issue.
@lfan_tv5 ай бұрын
Hi, for the image I need to do like this else it will popup the error Image(uiImage: (sample.image == nil ? Constants.placeholder : sample.image)!) do you know why?
@StewartLynch5 ай бұрын
Does it give the same error if you check my completed source code for this branch?
@gcoldfyre3 ай бұрын
@@StewartLynch it does for me. When I add that line I get a "Failed to produce diagnostic for expression, please submit a bug report." I tried with both the completed code from source branch 2 and 3 as well but this line remains the same and gives me a Failed to build PhotosListView.swift error on the app
@StewartLynch3 ай бұрын
I just downloaded and tested the completed code for this project and get no errors.
@gcoldfyre3 ай бұрын
@@StewartLynch Yep, I ran it from your project and it worked fine. I don't see any differences between your code and mine but thanks for the reply. Loving your series so far! I'll continue through this example now.
@mkhasson976 ай бұрын
Thank you very much for you awersome videos and the perfect explainations
@StewartLynch6 ай бұрын
Glad you like them!
@dirkfu62806 ай бұрын
Hi Stewart, great video again, can't wait to find out what solution you came up with in the camera part, especially because there is no SwiftUI API (yet?). Small nitpick: Instead of Image (uiImage: sample.image == nil? Constants.placeholder : sample.image!) whouldn't be Image (uiImage: sample.image ?? Constants.placeholder) much simpler?
@StewartLynch6 ай бұрын
You are correct. Simpler indeed
@joywu16 ай бұрын
I had seen your old series in this function(not swift data), but can you add one more function is when I pick the photo will show the photo on map?
@StewartLynch6 ай бұрын
That would be another level and some reverse geocode lookup on the meta data.
@joywu16 ай бұрын
@@StewartLynch thank you for your explanation, would you have any plans to this function in the future serious?
@StewartLynch6 ай бұрын
@@joywu1 I have a lot of other videos planned right now but I will add this to my list
@marcskieskie64932 ай бұрын
Hello, How make for take photo in square (1:1) mode ? or allow the user to switch the mode (4:3, 1:1; 16:9) ?
@StewartLynch2 ай бұрын
You will have to design your own camera. This one that you get is pretty basic unfortunately.
@marcskieskie64932 ай бұрын
@@StewartLynch Thanks for your reply. I'll give it a try.
@mhfs614 ай бұрын
Thank you Stewart.
@StewartLynch4 ай бұрын
You are very welcome
@Johnson4o4 ай бұрын
The placeholder images are not visible in dark mode, is there any way to fix this? The image generated by systemImage is gray, so it’s perfectly visible in dark mode, however the image generated by systemName is black with transparent elements, so it becomes completely invisible in dark mode. Otherwise awesome tutorial, thank you!
@StewartLynch4 ай бұрын
Try changing the constant to this: enum Constants { static let placeholder = UIImage(systemName: "photo.fill")!.withRenderingMode(.alwaysTemplate) }
@sergiovinhal59346 ай бұрын
Thank you .
@RaethanChristianSupatan6 ай бұрын
Hi! I tried storing multiple photos as an array of data but when I try to display them in a lazyvgrid, the performance of the app become slow. Is there any way to improve performance if there are a lot of photos to be displayed?
@StewartLynch6 ай бұрын
Do you mean you have a property that is an array of Data? If so, create a new object with a Data property and then store as a one to many relationsip to that object.
@RaethanChristianSupatan6 ай бұрын
@@StewartLynch Is that the reason why performance was slow? Also, can I not store my array of data property to external storage?
@StewartLynch6 ай бұрын
I have been reading that this is problematic. I have had no issues using one to many releationship.
@RaethanChristianSupatan6 ай бұрын
@@StewartLynch I see tysm!
@raethansupatan73416 ай бұрын
Is there a way to load the image data asynchronously?
@isaiasizquierdo33696 ай бұрын
Thank you
@StewartLynch6 ай бұрын
You're welcome
@RoxieS-pv4ke6 ай бұрын
make a video how to add an array of images or videos to a SwiftData, and I'm wondering right now if I store images not in a Data? but in an URL? ,,, it will be very interesting, there are no such lessons on KZbin
@StewartLynch6 ай бұрын
This is pretty straight forward. Whether you are saving as a URL or as Data, create a new model for the image. It might only have the single property for the data or url. Then you can link the array to your object as a one to many relationship.
@RoxieS-pv4ke6 ай бұрын
@@StewartLynch yes, but I think the second property needs to be included in the new photo model is ID
@StewartLynch6 ай бұрын
Id is not necessary a Swift data model already has a record Id.
@RoxieS-pv4ke6 ай бұрын
@@StewartLynch today I will try to change the code a little)) and then I did it in my model using an attribute, it works - adds an array of photos, but when deleting an entry, it throws it out of the application
@StewartLynch6 ай бұрын
@RoxieS-pv4ke What do you mean, throws it out of the application? What is your delete rule on the relationship?