OSDN Git Service

可能な限り#keyPathを使うように変更
authormasakih <masakih@users.sourceforge.jp>
Sun, 8 Oct 2017 04:26:46 +0000 (13:26 +0900)
committermasakih <masakih@users.sourceforge.jp>
Sun, 8 Oct 2017 04:26:46 +0000 (13:26 +0900)
KCD/ServerDataStore.swift

index 9370348..33d7a5d 100644 (file)
@@ -76,7 +76,7 @@ extension ServerDataStore {
     
     func decksSortedById() -> [Deck] {
         
-        let sortDec = NSSortDescriptor(key: "id", ascending: true)
+        let sortDec = NSSortDescriptor(key: #keyPath(Deck.id), ascending: true)
         
         guard let decks = try? objects(of: Deck.entity, sortDescriptors: [sortDec]) else { return [] }