🚨Bug Fix🚨 There seems to be an issue with the way the clipping images is handled in SwiftUI it can cause elements to overflow and block the touch targets of other element in this case the todo button. In order to fix this you'll need to set the z index on the image to -1, below is an example of this Replace Image with the following below Image(uiImage: uiImage) .resizable() .aspectRatio(contentMode: .fill) .frame(height: 120) .clipShape( RoundedRectangle(cornerRadius: 10, style: .continuous) ) .zIndex(-1)
@tundsdev Жыл бұрын
There seems to also be a bug where if you have multiple images on the screen you can only view the last one. Which seems to be a bug with the lib that I used oooppsss lol. I'll try to post a gist with a link to some update I made to resolve this issue.
@holycrosscv9 ай бұрын
I removed the lib, and it still selects just the last image. @@tundsdev
@gccount8 ай бұрын
finally , this video helped me. the key part is converting image data to UIImage , then to Image
@tundsdev8 ай бұрын
Glad it helped!
@penyt Жыл бұрын
Looking forward to CloudKit with SwiftData! Thanks for another super useful tutorial :)
@tundsdev Жыл бұрын
Glad you enjoyed it 👌🏾
@CarlosRomanAlcaide6 ай бұрын
This video is one of the best explanations I’ve found about how to store images in SwiftUI!
@tundsdev6 ай бұрын
Glad it was helpful!
@nileshjdarji4 ай бұрын
Wow Tunds. I like what you showed for the external storage. Very nice. I am really enjoying this series.
@kkpvb Жыл бұрын
Good Tutorial, I’m learning SwiftUI from Thailand. 🙌🏻
@tundsdev Жыл бұрын
Awesome i recently went bangkok it was really nice, especially your mcdonalds 💕
@kkpvb Жыл бұрын
Really?, I guess if you've been here recently Show that you like McDonald's decorated as Newjeans for sure hahaha
@HaukeCode-ye8fe Жыл бұрын
Really loving these videos on SwiftData Tunds! Would love to see a lesson on how to integrate CloudKit with SwiftData so different users can access related data. Specifically would be cool to see an example where you use some shared cloud data as well as some local data and keep things straight. Thank you!
@tundsdev Жыл бұрын
Thanks, glad you’re enjoying it. I do have some cloudkit content planned soon, for both this & another paid course i’m workin on. Also do you mean users can share todo’s? And like collaborate on them together?
@HaukeCode-ye8fe Жыл бұрын
@@tundsdev yes! A shared todo app where you can assign one another is a great example. Mostly wanting to learn how to think about managing local private data through SwiftData and then local shared data with SwiftData and iCloud and how to manage between them. For instance, what if I created a private todo and then later wanted to add someone else to it. Hope that makes sense, thanks! One other thing I am interested in, but may be to far off topic is also how you might manage local SwiftData and Firebase integration for cloud sharing.
@ConnorH713 Жыл бұрын
Great video, before this I was trying to cherry pick from older Core Data tutorials to achieve this functionality for my app. Thanks for posting!
@tundsdev Жыл бұрын
Glad it helped!
@macmcmillen6282 Жыл бұрын
Excellent series of videos. You explain things very well, so thanks for sharing this!
@tundsdev Жыл бұрын
Thanks, glad you enjoyed it 🤝
@sxmiotb2834 Жыл бұрын
this was a big help. thank you so much
@tundsdev Жыл бұрын
Great to hear 👌🏾
@keeleycarrigan17 күн бұрын
Great tutorial!😊
@profgallaugher10 ай бұрын
Your work is great. Keep at it!
@tundsdev10 ай бұрын
Thanks a lot!
@thomasfahlke4253 Жыл бұрын
Hi tunds, great work and yes, I learned a lot. Just right for the next project. Thank you
@tundsdev Жыл бұрын
That’s great to hear 👌🏾
@ben.aka.bigben Жыл бұрын
Well done, thank you for this valuable tutorial
@jessicathedoc8569Ай бұрын
Great content!!!
@keatsp Жыл бұрын
Amazing job. Very easy to follow your tutorials. I would love to see how to get an image from the camera.
@tundsdev Жыл бұрын
Thanks & SwiftUI doesn’t support choosing the camera as an option just yet you still have to use UIKit mixed in with SwiftUI 👌🏾
@macmcmillen6282 Жыл бұрын
Have you tried saving multiple images per todo? I'm guessing that would require an array of the Data type. I see that Beta 8 has been released. Looks like a lot of SwiftData fixes.
@meet071 Жыл бұрын
Hello. Can you please share how we can store multiple images as a form of array in swiftData. Thanks :)
@tundsdev Жыл бұрын
Sure I can add it to my list 👌🏾
@gerardgomez5987 Жыл бұрын
Also interested in this.
@nguyenan832711 ай бұрын
Hi Tunds, thanks for your tutorial. However, i read in multiple places that we should not store image data directly in database field, should we do that for SwiftData as well, what's your ideas on this?
@tundsdev11 ай бұрын
👋🏾 so technically this isnt stored in the database its stored in an external reference to a folder on the device to prevent large data being saved in the data model
@nguyenan832711 ай бұрын
oh thanks for your explanation if can pls help to guide on how to store multiple images in a record, thank you very much! I try the array but it keeps having some issues 😅
@w0mblemania Жыл бұрын
This was very useful, thanks! Question: by default, if we use the .externalStorage attribute, are the images being saved in a place automatically backed up by iCloud?
@tundsdev Жыл бұрын
Thanks & nope to get that functionality you’d to setup an icloud container, which I may have a video on very very soon 👀
@w0mblemania Жыл бұрын
@@tundsdev Thanks!
@misaellanderosichante32935 ай бұрын
Would the image sync with CloudKit if we use external storage?
@PeteLorimer Жыл бұрын
Great video. I followed along and got images into my app in no time. Question: When using the @Attribute(.externalStorage) where exactly does the image get stored? And if I were to integrate CloudKit for syncing the data across all my devices, would the images get synced as well?
@tundsdev Жыл бұрын
Thanks & similar to CoreData its stored in a hidden folder that is then referenced within SwiftData rather than the whole image being stored. I’ve not worked too much with CloudKit but it’s next up on my list to explore 👌🏾
@rudiprestianni7822 Жыл бұрын
really like your tutorials. Would you do a tutorial on how to handle dictionaries with SwiftData?
@tundsdev Жыл бұрын
I have an upcoming vid that will show you how to handle custom data types SwiftData doesn’t support, another alternative is to use json & save it as a string amd convert it back to an object
@pgong415 Жыл бұрын
First, your video is really helpful especially in terms of saving images in Data type rather than image one and storing the images in an external file. Second, there is a bug in my experiment - if pick one image for item 1, for example, and one image for item 2, item 3, so on, when you click on image for item 1 or item 2, always the image for item 3 (or last item) is presented. I do not know if this is the case for your app or something wrong for my experiment. Appreciate it in advance for your reply. Thank you for your efforts anyway.
@tundsdev Жыл бұрын
Hi, So this does store the image externally it’s actually better to do this rather than store the data directly in the database, there’s been a few updates to Xcode since I last released this so i’d have to investigate this issue for you 👌🏾
@tundsdev Жыл бұрын
Hey so I just had a quick look and it's linked to the library that I've used in the video...When I have some time i'll try to post a gist with an updated solution without the lib but it won't have zoom functionality etc.
@ian7666 Жыл бұрын
Be nice to see a comparison of SwiftData and Realm… I love Realm, should I even think of using SwiftData?
@tundsdev Жыл бұрын
Nice suggestion, i'll consider it!
@misaellanderosichante32935 ай бұрын
Good tutorial bro help me a lot
@huynhvandutran8014 Жыл бұрын
Do you know where the actual data (imageData in your example) is stored when we use externalStorage? Like is it in the Document folder? I don't see the image data in there.
@tundsdev Жыл бұрын
👋🏾 You have to open up the path to the data model file and in that folder there is folder called external storage that holds all of the external files
@WilfClegg Жыл бұрын
Hi Tunds! Once again, many thanks for this tutorial. It rocks, as usual. I noticed a small bug (maybe it is on my install only?) When I add two or more items to the ToDo list (and each with a photo), The SwiftUIImageViewer doesn't always present the image that I tap on. Can you check on this to see if works ok on your install? Thanks....Wilf
@tundsdev Жыл бұрын
Hey so I just had a quick look and it's linked to the library that I've used in the video...When I have some time i'll try to post a gist with an updated solution without the lib but it won't have zoom functionality etc.
@WilfClegg Жыл бұрын
@@tundsdev Thanks Tunds, I’m glad you confirmed the issue. Alternatively, I can create a .sheet, then apply .infinity framing, pinch and magnification, etc. This would avoid the need for an add-on package?
@tundsdev Жыл бұрын
@WilfClegg Yep that should work too 👌🏾
@kenturnbull9679 Жыл бұрын
I like this and can use it. I am working on an inspection app that requires more than one photo for an item. How about making your image into a carousel or horizontal scrollview to allow more than one image? As for Butties...do you still have Jam butties?
@tundsdev Жыл бұрын
I love jam butties 🔥🔥🔥 i did consider it but the video would be way too long 😬
@kenturnbull9679 Жыл бұрын
>@@tundsdev My friend from Manchester also used the expression ..."Manky" and called me Neddy; and I'm Canadian. How about another video on using the package to generate a collection of photos for an item? Love to see it extended.
@TB84060 Жыл бұрын
Yes, please help with this. I am in the exact same quandary. I want to show a horizontal scrollview of images for each item.
@anirudhcodes Жыл бұрын
Awesome
@tundsdev Жыл бұрын
Glad you enjoyed it 👌🏾
@이도헌-m3k Жыл бұрын
I'd like to learn how to handle images in Coredata, is there a video on that?
@tundsdev Жыл бұрын
Nope, not yet. Maybe i’ll add it to my shortlist 👌🏾
@이도헌-m3k Жыл бұрын
@@tundsdev Thank you. I'm trying to store the image as a binary data type with Core Data, but most of them recommended storing only the PATH and managing it locally. If I store only PATH in coredata as recommended, won't the local images be deleted if the user deletes the app when using cloudkit? Then when I reinstall the app, I won't be able to retrieve the images even if PATH exists in coredata. I'm still looking for a way to store and manage them correctly in coredata (considering that there will be many images). I'd be grateful if you could post a video about it in the future. 🙏
@benjiloya_ios_dev11 ай бұрын
how to add Video in swiftData???
@johnpill19 ай бұрын
Came here for the tutorial... left to get a bacon butty 😂
@tundsdev9 ай бұрын
Brown, Ketchup or Both sauces? Which one are you? 👀
@johnpill19 ай бұрын
@@tundsdev Bacon bap = BBQ. Sausage bap = Ketchup. Fry up = Brown. There are rules :D
@johnpill19 ай бұрын
On a less serious note, I was trying to get a slider working in SwiftData in the Bindable view and I keep getting an error on the container form. Works fine in the original sheet. Is this a SwiftData issue or something I am missing?
@tundsdev9 ай бұрын
I’d need more context to try to help out unfortunately, this sounds very specific to your project
@holycrosscv Жыл бұрын
Loving this series. Thanks! Did you find that @Relationship(.nullify, inverse: \Category.taskCat) throws an error with beta 6 "Type 'PropertyOptions' has no member 'nullify'" Thanks. Blessings, --Mark