2 // BookmarkDataStore.swift
5 // Created by Hori,Masaki on 2017/01/06.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 extension CoreDataConfiguration {
13 static let bookmark = CoreDataConfiguration("Bookmark")
16 final class BookmarkDataStore: CoreDataAccessor, CoreDataManager {
18 static let core = CoreDataCore(.bookmark)
20 static let `default` = BookmarkDataStore(type: .reader)
22 class func oneTimeEditor() -> BookmarkDataStore {
24 return BookmarkDataStore(type: .editor)
27 required init(type: CoreDataManagerType) {
29 context = BookmarkDataStore.context(for: type)
37 let context: NSManagedObjectContext
40 extension BookmarkDataStore {
42 func createBookmark() -> Bookmark? {
44 return insertNewObject(for: Bookmark.entity)