title: How to store String Enums with Realm
body: <p>I can't save data as enum in Realm. When I track the state of a variable, and save, the old value remains, instead of the new one. What am I doing wrong?</p>
  
  <p>I used a setter and a getter, but still the problem is not solved.</p>
  
  <pre><code>import RealmSwift
  
  class Transaction: Object {
  
  var accounting: Accounting = .income
  @objc dynamic var amount = 0
  @objc dynamic var date = ""
  @objc dynamic var note = ""
  
  private var privateCategory: String = Category.noCategories.rawValue
  var category: Category {
      get { return Category(rawValue: privateCategory)! }
      set { privateCategory = newValue.rawValue }
    } 
  }
  
  enum Category: String {
     case noCategories = "No сategories"
     case food = "Food"
     case cafesAndRestaurants = "Cafes And Restaurants"
     case manufacturedGoods = "Manufactured Goods"
     case forceMajeure = "Force Majeure"
     case entertainment = "Entertainment"
  }
  </code></pre>
  
  <p>When I try to save a property, the Сategory is saved by default("No categories")</p>
  
  <pre><code>let transactionOne = Transaction()
      transactionOne.accounting = .consuption
      transactionOne.amount = 250
      transactionOne.category = .food
  </code></pre>
  
  <blockquote>
    <p>transaction   privateCategory String  "No categories" </p>
  </blockquote>