UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Looking for recommendation: Core Data and temporary data using a List

Forums > SwiftUI

Greetings,

I'm working a project that wil eventually take information from items in a list, and for each of these items, the goal is to check if the network port is opened or not and return the result.

To build the list, I use Core Data, so the information is stored in the application and can be re-used at a later time, however, the returned data, here the IP Address and the Status are temporary information for me and I do not want to store them in Core Data and want them evaludated every time I run the function to check the status of the port.

My question relates to what would be the best course of action to temporay store this information and having it "attached" to the item in the list, so when I tap on said item, I get the all the details?

I'm not looking for actual code, but guidance on things to leverage to achieve the outcome. I try googling a bit already, but not even sure how to formulate it so I get relevant answers.

Here is a mockup of the app: List https://ibb.co/FX4x0Zp

Details (Hostname, Environment and Port are mandatory and in Core Data, the rest will be dynamic and temporary) https://ibb.co/c2qk714

Thank you

1      

Look into transient properties in Core Data. Those are properties that you include as part of your model but although they are tracked by Core Data while in use, they are not persisted to the data store. That might be what you're looking for.

1      

Thank you very much for the swift reply. Will look into it :)

1      

Looks like it did what I wanted, thanks a lot :)

1      

Hacking with Swift is sponsored by RevenueCat.

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.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.