ya-s-u / TalkBox

LINE talk backup app written in Swift
5 stars 0 forks source link

Realmスキーマ設計 #5

Open ya-s-u opened 8 years ago

ya-s-u commented 8 years ago
class Talk: Object {
  dynamic var title = ""
  let messages = List<Message>()
  dynamic var owner: User?
  dynamic var created = NSDate()
  dynamic var updated = NSDate()
}
class Message: Object {
  dynamic var user: User?
  dynamic var text = ""
  dynamic var favorited = false
  dynamic var created = NSDate()
}
class User: Object {
  dynamic var name = ""
  dynamic var count = 0
  dynamic var talk: Talk?
}
ya-s-u commented 8 years ago

https://realm.io/jp/docs/swift/latest/#section-4