4 Replies
      Latest reply on Jan 17, 2020 12:52 AM by T3chWarri0r
      T3chWarri0r Level 1 Level 1 (0 points)

        I'm leaning to code there for i made up my own Project so i learn a veriaty of stuff along doing that. My next step is something like an in App on device database. I know so far it has something to do with core data . I'd like some tipps and tricks maybe and suggestions where i can find waht I'm looking for I dont now the specific terminology maybe .

         

        So a quick rundown what i have in mind.

        It's an App to store character sheets for roleplaying games. In this shoulde be stored like more then one charcter at once like up to 100 or so I doubt this limit will ever be reached but who knows. Each Character has 11 attributes und some othere values that are calculated out of these attribute(all interger). Also each character has a set of skills ( physikal/mental/speech) that can easy reach like 50 entries combined(set of strings and integers). Then you have stuff that could augment or decrease values from your attributes stats. Not to forget that you have also like gear and vehicle and other stuff that needs to be stored and access along the usage of your charcter and the app.

         

        So is this possible with only swift? Do I create like a file for each charcter ? Can the Appuser input most of the stuff on his own or do i give him options he just selects or is there no limitation and its just an UI thing i can/could provide? And can i access and store like a picture if the user wants to?

        • Re: Database with Swift and SwiftUi
          Claude31 Level 8 Level 8 (7,845 points)

          Did you see this tutorial ?

           

          h ttps://www.raywenderlich.com/7569-getting-started-with-core-data-tutorial

          • Re: Database with Swift and SwiftUi
            Claude31 Level 8 Level 8 (7,845 points)

            It's an App to store character sheets for roleplaying games. In this shoulde be stored like more then one charcter at once like up to 100 or so I doubt this limit will ever be reached but who knows.

            That's not a limit for CoreData.

             

            Each Character has 11 attributes und some other values that are calculated out of these attribute(all interger). Also each character has a set of skills ( physikal/mental/speech) that can easy reach like 50 entries combined(set of strings and integers).

            You have to write down precisely your data model.

            Computed var will be computed in Swift, not in CoreData

            This will be needed both for the Swift code and for the model in CoreData, to define entities (Character) and attributes.

             

            Then you have stuff that could augment or decrease values from your attributes stats. Not to forget that you have also like gear and vehicle and other stuff that needs to be stored and access along the usage of your character and the app.

            That will be other entities in CoreData

              • Re: Database with Swift and SwiftUi
                T3chWarri0r Level 1 Level 1 (0 points)

                So for a model you mean i need to write down first what belongs to what?

                E.g. Entitie: Character

                          Attribute: Body

                          .

                          .

                         Entitie: artificial arm

                         Attribute : Augemet Body  Attribute

                          Relationship: Attribut Body

                     Weapon:

                          Attribute: Damage

                          .

                 

                Something like this ?

                 

                And i understand right that I use the core data entries in normal swift code and then store them back after i applied the changes to them.