RichieBooksBook
Objective-C
@interface RichieBooksBook : NSObject
-(nonnull instancetype) init NS_UNAVAILABLE;
@property (nonatomic, readonly, nonnull) MaggioGuid *guid;
@property (nonatomic, readonly) NSInteger version; //!< Version number of downloaded book instance. Book can be modified on server and that will increment version number. The version number is zero when book hasn't been downloaded. Zero is not a valid version number.
@property (nonatomic, readonly) RichieBooksBookPresentationState presentationState;
@property (nonatomic, readonly) RichieBooksBookDiskState diskState;
@property (nonatomic, readonly, nullable) RichieBooksBookLoadingState *loadingState; //!< @p nil if loading is not in progress.
@property (nonatomic, readonly, nullable) NSDate *modificationDate;
-(BOOL) touchMetadata;
-(void) addListener:(nonnull id<RichieBooksBookListener>)listener; //!< @note Listeners are held weakly.
-(void) removeListener:(nonnull id<RichieBooksBookListener>)listener;
@end
Swift
class RichieBooksBook : NSObject
Undocumented
-
Unavailable
Undocumented
Declaration
Objective-C
-(nonnull instancetype) init NS_UNAVAILABLE;
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) MaggioGuid *guid
Swift
var guid: MaggioGuid { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger version;
Swift
var version: Int { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) RichieBooksBookPresentationState presentationState
Swift
var presentationState: RichieBooksBookPresentationState { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) RichieBooksBookDiskState diskState
Swift
var diskState: RichieBooksBookDiskState { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly, nullable) RichieBooksBookLoadingState *loadingState;
Swift
var loadingState: RichieBooksBookLoadingState? { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSDate *modificationDate
Swift
var modificationDate: Date? { get }
-
Undocumented
Declaration
Objective-C
-(BOOL) touchMetadata;
Swift
func touchMetadata() -> Bool
-
Undocumented
Declaration
Objective-C
- (void)addListener:(nonnull id<RichieBooksBookListener>)listener;
Swift
func add(_ listener: any RichieBooksBookListener)
-
Undocumented
Declaration
Objective-C
-(void) removeListener:(nonnull id<RichieBooksBookListener>)listener;
Swift
func remove(_ listener: any RichieBooksBookListener)
-
Undocumented
Declaration
Objective-C
-(BOOL) startDownloadFromURL:(nonnull NSURL *)url version:(NSInteger)bookVersion decryptorProvider:(nonnull RichieCryptorProvider)decryptorProvider useBackgroundDownload:(BOOL)useBackgroundDownload userInfo:(nullable id)userInfo;
Swift
func startDownload(from url: URL, version bookVersion: Int, decryptorProvider: @escaping RichieCryptorProvider, useBackgroundDownload: Bool, userInfo: Any?) -> Bool
-
Undocumented
Declaration
Objective-C
-(BOOL) continueDownloadWithDecryptorProvider:(nonnull RichieCryptorProvider)decryptorProvider userInfo:(nullable id)userInfo;
Swift
func continueDownload(decryptorProvider: @escaping RichieCryptorProvider, userInfo: Any?) -> Bool
-
Undocumented
Declaration
Objective-C
- (void)stopLoading;
Swift
func stopLoading()
-
If presentationState is Presentable, this method will call completion block immediately.
@returns NO if presentation cannot be started, otherwise YES.
Declaration
Objective-C
- (BOOL)prepareForPresentationInWindowSize:(CGSize)windowSize completion: (void (^_Nonnull)(BOOL, NSError *_Nullable)) completion;
Swift
func prepareForPresentation(inWindowSize windowSize: CGSize, completion: @escaping (Bool, (any Error)?) -> Void) -> Bool
-
-presentFromViewController:
adSlotName: eventListeners: animated: fromView: withDisplayedImage: completion: Presents a view controller (from @p presentingViewController ) for reading this book.
If @p transitionStartSourceView is given, transition animation tries to animate nicely from the view to the presented state. @p currentlyDisplayedImage can be given, if one exists naturally (for example, @p transitionStartSourceView is a UIImageView with correct aspect ratio), to avoid explicit snapshot of the view. @p transitionStartSourceView must be in presentingViewController.view’s view hiearchy.
Declaration
Objective-C
- (BOOL) presentFromViewController: (nonnull UIViewController *)presentingViewController adSlotName:(nullable NSString *)adSlotName eventListeners: (nullable NSArray<id<RichieBooksReaderUiEventListener>> *) eventListeners animated:(BOOL)animated fromView:(nullable UIView *)transitionStartSourceView withDisplayedImage:(nullable UIImage *)currentlyDisplayedImage completion:(void (^_Nullable)(void))completion;
Swift
func present(from presentingViewController: UIViewController, adSlotName: String?, eventListeners: [any RichieBooksReaderUiEventListener]?, animated: Bool, from transitionStartSourceView: UIView?, withDisplayedImage currentlyDisplayedImage: UIImage?, completion: (() -> Void)? = nil) -> Bool
Parameters
presentingViewController
View controller from which the book reading view controller is presented from.
adSlotName
Name of the ad slot from which slot ads are injected between book pages (according to slot placement rules).
eventListeners
Listeners for reading UI events. Useful for analytics logging, for example.
animated
Pass @p YES to animate the presentatation; otherwise, pass @p NO.
transitionStartSourceView
If animating the transition, this is the source view from which the transition begins. It should contain book cover image.
currentlyDisplayedImage
If animating the transition, use this image as the contents of @p transitionStartSourceView so a separate snapshot is not needed. If animating and nil, @p transitionStartSourceView is snapshotted to get image for transition.
completion
The block to execute after the presentation finishes. You may specify nil for this parameter.
Return Value
@p YES if view controller was presented, @p NO if failure prevented presentation (for example, presentingViewController is already presenting a view controller).
-
Undocumented
Declaration
Objective-C
-(nullable RichieBooksReaderViewController *) presentableViewControllerWithAdSlotName:(nullable NSString *)adSlotName eventListeners:(nullable NSArray<id<RichieBooksReaderUiEventListener>>*)eventListeners;
Swift
func presentableViewController(withAdSlotName adSlotName: String?, eventListeners: [any RichieBooksReaderUiEventListener]?) -> RichieBooksReaderViewController?