Swift 編寫的 CoreData 管理庫:SugarRecord
使用Swift編寫的CoreData管理庫,開發者可通過它更簡單地使用CoreData和REALM。
適合初級和高級開發者,完全自定義,語法友好,兼容OS X和iOS,文檔支持完善,測試完善(所有組件均使用XCTest測試)。
可在不同的堆棧間進行更改,而不會影響到app的其余部分。
百分百Swift編寫,對于Objective-C,需要封裝。
如果需要在CoreData和Realm之間進行遷移,僅需確保項目的屬性名稱一致。
SugarRecord自動管理后臺操作。
The scheme above shows the structure of SugarRecord. It's formed by:
- Database Models Extensions: To add the sugar syntax that links these models with SugarRecord and the database.
- Finder: SugarRecord custom element to abstract the querying components from the type of storage (Realm or CoreData)
- Core: Main component of the library that translates Save/Delete/Find calls into internal operations using the stacks set.
- SugarRecord contexts: Altough Realm doesn't have contexts as we have in CoreData, we have created abstracted contexts that surround the user operations with models independently if you are using CoreData or Realm. Yeah!
- Stack: The storage stack is another key piece in SugarRecord because it knows how and when persist/fetch/delete your objects into the database. You can tell SugarRecord which stack it should use. </ul>



本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!