title: easier way to enter data into core data
body: <p>So I have an entity called "Achievement" in my core data model and it holds data that is implemented through a function on the first launch of the application. </p>
  
  <p><a href="https://i.stack.imgur.com/zl0YG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zl0YG.png" alt="enter image description here"></a></p>
  
  <p>My problem is that I have 30 different achievements in my game that all have different names and amounts and differences from the rest of the achievements, so i'm currently using switch statements to implement it through the function as seen below.</p>
  
  <pre><code>func createAchievements(aName: String, Des: String, Image:String, Amount:NSNumber, Needed: NSNumber, Stage: NSNumber, SearchName: String) {
  
      let A:Achievement = NSEntityDescription.insertNewObject(forEntityName: "Achievement", into: CoreDatabaseContoller.getContext()) as! Achievement
  
      A.theName = aName
      A.theDescription = Des
      A.theImage = Image
      A.aAmount = Amount
      A.aNeededAmount = Needed
      A.aStage = Stage
      A.theSearchName = SearchName
  
      CoreDatabaseContoller.saveContext()
  
  }
  
  
  
  
  func giveDataForAchievements() {
  
      if achievementsGenerated == false {
  
          for count in 1...27 {
  
              var aName = "None"
              var aDesc = "None"
              var aImage = "locked"
              var aAmount:NSNumber = 0
              var aNeededAmount:NSNumber = 1
              var aStage:NSNumber = 0
              var aSearchName = ""
  
              switch count {
  
              case 1:
  
                  aName = "DAILY"
                  aDesc = "Daily Achievement"
                  aImage = "locked"
                  aAmount = 0
                  aNeededAmount = 1
                  aStage = 3
                  aSearchName = "Ach0"
  
              case 2:
  
                  aName = "DAILY"
                  aDesc = "Daily Achievement"
                  aImage = "locked"
                  aAmount = 0
                  aNeededAmount = 1
                  aStage = 3
                  aSearchName = "Ach1"
  
  
         ... plus 30 more of these
  
       }
  
       createAchievements(aName: aName, Des: aDesc, Image: aImage, Amount: aAmount, Needed: aNeededAmount, Stage: aStage, SearchName: aSearchName)
    }
  </code></pre>
  
  <p>I was wondering if their is a better way to do this because it looks so bad having long lines of code, the achievement values are changed once they are implemented into core data, its only the initial settings that need to be given to core data    </p>