RichieBooksLibrary
Objective-C
@interface RichieBooksLibrary : NSObject
Swift
class RichieBooksLibrary : NSObject
RichieBooksLibrary manages a set of books on the local file system.
-
Factory method for creating a library instance. More than one instance must not be created, because instances will point to same directory on disk.
Declaration
Objective-C
+ (nonnull RichieBooksLibrary *) libraryWithRichieAds:(nonnull RichieAds *)richieAds backgroundDownloadManager: (nullable RichieBackgroundDownloadManager *)backgroundDownloadManager;Swift
/*not inherited*/ init(richieAds: RichieAds, backgroundDownloadManager: RichieBackgroundDownloadManager?) -
Factory method for creating a library instance with storage in Library rather than the standard Library/Caches.
Declaration
Objective-C
+ (nonnull RichieBooksLibrary *) libraryWithRichieAds:(nonnull RichieAds *)richieAds backgroundDownloadManager: (nullable RichieBackgroundDownloadManager *)backgroundDownloadManager libraryRootDirectory:(nullable NSString *)libraryRootDirectory;Swift
/*not inherited*/ init(richieAds: RichieAds, backgroundDownloadManager: RichieBackgroundDownloadManager?, libraryRootDirectory: String?) -
Unavailable
Undocumented
Declaration
Objective-C
-(nonnull instancetype) init NS_UNAVAILABLE; -
Undocumented
Declaration
Objective-C
- (void)addListener:(nonnull id<RichieBooksLibraryListener>)listener;Swift
func add(_ listener: any RichieBooksLibraryListener) -
Undocumented
Declaration
Objective-C
-(void) removeListener:(nonnull id<RichieBooksLibraryListener>)listener;Swift
func remove(_ listener: any RichieBooksLibraryListener) -
Undocumented
Declaration
Objective-C
-(void) updateAnalyticsExtraAttributes:(nullable NSDictionary<NSString *, id> *)extraAttributes;Swift
func updateAnalyticsExtraAttributes(_ extraAttributes: [String : Any]? = nil) -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) id<RichieBooksBookmarkStore> bookmarkStoreSwift
var bookmarkStore: any RichieBooksBookmarkStore { get }
-
Migrate books from standard Library/Caches to Library.
Declaration
Objective-C
- (void)migrateBooksWithCompletion:(nullable void (^)(BOOL))completion;Swift
func migrateBooks() async -> Bool -
Before trying to create new books or see what other books exit, existing books must be loaded from disk. It’s a programmer error to try to modify the library before loading has been done.
Declaration
Objective-C
- (void)startLoadingBooks;Swift
func startLoadingBooks() -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) BOOL hasLoadedBooksSwift
var hasLoadedBooks: Bool { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, nullable, readonly) NSArray<RichieBooksBook *> *booksSwift
var books: [RichieBooksBook]? { get } -
Undocumented
Declaration
Objective-C
-(nullable RichieBooksBook *) createBookWithGuid:(nonnull MaggioGuid *)guid;Swift
func createBook(with guid: MaggioGuid) -> RichieBooksBook? -
Undocumented
Declaration
Objective-C
-(void) updateBook:(nonnull RichieBooksBook *)book;Swift
func updateBook(_ book: RichieBooksBook) -
Note
Do not delete a book that is presented to the user for reading.After deleting the book, the instance is invalid and it’s a programmer error to use it.
Declaration
Objective-C
- (void)deleteBook:(nonnull RichieBooksBook *)book;Swift
func deleteBook(_ book: RichieBooksBook) -
Undocumented
Declaration
Objective-C
-(void) deleteBooksWithIds:(nonnull NSSet <NSString *> *)bookIds;Swift
func deleteBooks(withIds bookIds: Set<String>) -
Undocumented
Declaration
Objective-C
-(BOOL) bookRequiresEntryDownload:(nonnull NSString *)bookId version:(NSInteger)version;Swift
func bookRequiresEntryDownload(_ bookId: String, version: Int) -> Bool