Other Protocols

The following protocols are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieAdsProtocol <NSObject>
    -(void) addSlotListListener:(id<RichieAdsSlotListListener>)listener;
    -(void) removeSlotListListener:(id<RichieAdsSlotListListener>)listener;
    -(BOOL) hasLoadedSlotAd:(NSString *)adIdentifier;
    -(void) startLoadingSlotAd:(RichieAdsAd *)ad;
    -(nullable UIImage *) placeholderImageForAdWithIdentifier:(NSString *)adIdentifier
                                                inOrientation:(RichieOrientation)orientation
                                                       inSlot:(NSString *)slotIdentifier;
    -(nullable UIImage *) placeholderImageForAdWithIdentifier:(nonnull NSString *)adIdentifier
                                                inOrientation:(RichieOrientation)orientation
                                             withContainerURL:(nonnull NSURL *)containerDir;
    -(CGRect) rectForDrawingPlaceholderImage:(UIImage *)image inRect:(CGRect)targetRect;
    -(void) startLoadingAdWithIdentifier:(NSString *)adIdentifier
                                 fromURL:(NSURL *)url
                        toContainerAtURL:(NSURL *)containerDir
                   useBackgroundDownload:(BOOL)useBackgroundDownload;
    -(void) loadAdWithIdentifier:(NSString *)adIdentifier
                  toContainerDir:(NSURL *)containerDir
           useBackgroundDownload:(BOOL)useBackgroundDownload
                        progress:(void (^ _Nullable)(int64_t bytesDownloaded, int64_t expectedBytes))progress
                      completion:(void (^)(BOOL succeeded, NSError * _Nullable error))completion;
    -(BOOL) hasLoadedAdWithIdentifier:(nonnull NSString *)adIdentifier
                       toContainerDir:(nonnull NSURL *)containerDir;
    -(BOOL) hasLoadedAdWithIdentifier:(NSString *)adIdentifier
                              fromURL:(NSURL *)adPackageURL
                     toContainerAtURL:(NSURL *)containerDir;
    -(void) invalidate;
    -(nullable RichieAdsSlotAdFlight *) nextFlightForSlotWithIdentifier:(nonnull NSString *)slotIdentifier;
    -(nullable RichieAdsView *) viewWithFrame:(CGRect)frame
                                  forAdFlight:(nonnull RichieAdsSlotAdFlight *)slotAdFlight
                                     delegate:(nonnull id<RichieAdsViewDelegate>)delegate
                                   parameters:(nullable NSDictionary<NSString *, NSString *> *)parameters;
    -(nullable RichieAdsView *) viewWithFrame:(CGRect)frame
                                 adIdentifier:(nonnull NSString *)adIdentifier
                                 containerURL:(nonnull NSURL *)containerDir
                                     delegate:(nonnull id<RichieAdsViewDelegate>)delegate
                                   parameters:(nullable NSDictionary *)parameters;
    
    -(void) deleteAdWithIdentifier:(nonnull NSString *)adIdentifier inContainerAtURL:(nonnull NSURL *)containerDir;
    -(void) containerWillBeDeleted:(nonnull NSURL *)containerDir;
    -(nullable RichieAdsAd *) adFromFlight:(RichieAdsSlotAdFlight *)flight;
    @end

    Swift

    protocol RichieAdsProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieAdsSlotListListener <NSObject>
    
    -(void) slotAdDidProgressLoadingWithIdentifier:(NSString *)adIdentifier
    							   downloadedBytes:(long long)downloadedBytes
    								 expectedBytes:(long long)expectedBytes;
    
    -(void) slotAdDidFinishLoadingWithIdentifier:(NSString *)adIdentifier success:(BOOL)success;
    
    -(void) slotListAdLoadingDidFinish;
    
    -(void) slotListAdsDidChange;
    
    @end

    Swift

    protocol RichieAdsSlotListListener : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieBackgroundTask <NSObject>
    
    -(void) endTask;
    
    @property (nonatomic, readonly) BOOL isRunning;
    
    @end

    Swift

    protocol RichieBackgroundTask : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieBackgroundTaskSource
    
    -(UIBackgroundTaskIdentifier) beginBackgroundTaskWithName:(NSString *)taskName
    										expirationHandler:(void(^)(void))handler;
    
    -(void) endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;
    
    /**
     Returns a lifetime token. Background task is ended when token object is deallocated or -endTask is called explicitly.
     There is not expiration handler, because we don't do anything in them.
     */
    -(id<RichieBackgroundTask>) backgroundTaskWithName:(NSString *)name;
    
    @end

    Swift

    @MainActor protocol RichieBackgroundTaskSource
  • RichieCryptor is an interface for encrypting or decrypting data.

    See more

    Declaration

    Objective-C

    @protocol RichieCryptor <NSObject>

    Swift

    protocol RichieCryptor : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieNSURLSessionTaskFactory <NSObject>
    
    -(NSURLSessionDataTask *) dataTaskWithRequest:(NSURLRequest *)request delegate:(id<NSURLSessionDataDelegate>)dataDelegate;
    
    -(NSURLSessionDownloadTask *) downloadTaskWithRequest:(NSURLRequest *)request delegate:(id<NSURLSessionDownloadDelegate>)downloadDelegate;
    
    @end

    Swift

    protocol RichieNSURLSessionTaskFactory : NSObjectProtocol, Sendable
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichiePageScrollerViewDataSource <NSObject>
    
    -(NSInteger) numberOfPagesInPageScrollerView:(RichiePageScrollerView *)pageScrollerView;
    -(UIView *) pageScrollerView:(RichiePageScrollerView *)pageScrollerView pageAtIndex:(NSInteger)pageIndex;
    -(CGFloat) pageScrollerView:(RichiePageScrollerView *)pageScrollerView widthOfPageAtIndex:(NSInteger)pageIndex; //!< Controls the width (or height in non-horizontalMode) of page. Height (or width) of page is used as returned by -pageScrollerView:pageAtIndex:, centered and respecting autoresizing masks.
    
    @optional
    
    -(CGFloat) pageScrollerView:(RichiePageScrollerView *)pageScrollerView paddingAfterPageAtIndex:(NSInteger)pageIndex;
    -(void) pageScrollerView:(RichiePageScrollerView *)pageScrollerView didRemovePageView:(UIView *)view atIndex:(NSInteger)pageIndex; //!< Called after view has been removed from view hierarcy.
    
    @end

    Swift

    @MainActor protocol RichiePageScrollerViewDataSource : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichiePageScrollerViewDelegate <NSObject>
    
    @optional
    -(void) pageScrollerViewWillBeginDragging:(RichiePageScrollerView *)pageScrollerView; //!< Called just as dragging starts.
    -(void) pageScrollerViewDidScroll:(RichiePageScrollerView *)pageScrollerView; //!< Called whenever view is scrolled.
    -(void) pageScrollerView:(RichiePageScrollerView *)pageScrollerView didScrollToPageAtIndex:(NSInteger)pageIndex fromPageAtIndex:(NSInteger)previousPageIndex; //!< Called when scrolling causes current page to change.
    -(void) pageScrollerView:(RichiePageScrollerView *)pageScrollerView didStopAtPageAtIndex:(NSInteger)pageIndex userGesture:(BOOL)userGesture; //!< Called after scrolling has stopped.
    -(void) pageScrollerViewDidEndDragging:(RichiePageScrollerView *)pageScrollerView; //!< Called after dragging ends.
    
    @end

    Swift

    @MainActor protocol RichiePageScrollerViewDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieSwiper <NSObject>
    
    -(CGRect) frameForPageAtIndex:(NSInteger)pageIndex; //!< Calculated frame for given pageIndex. Useful for returning views with correct frame from DataSource.
    
    
    @property (nonatomic) NSInteger numberOfPages;
    
    
    /**
     The index of the page currently being displayed in the swiper.
     Setting this property is same as calling -setCurrentPageIndex:newPageIndex animated:NO.
     Changing current page index programmatically will cause delegate notifications of page disappearing and appearing called normally.
     */
    @property (nonatomic) NSInteger currentPageIndex;
    
    /**
     Changes the page currently being displayed in the swiper. If animated is YES, the change will happen with a scrolling animation.
     
     Changing current page index programmatically will cause delegate notifications of page disappearing and appearing called normally.
     */
    -(void) setCurrentPageIndex:(NSInteger)newPageIndex animated:(BOOL)animated;
    
    
    
    /**
     Causes DataSource to be queried and all current data to be discarded. Analogous to UITableView method -reloadData.
     
     NOTE: Calling this won't cause -swiper:pageDidDisappear: delegate method to be called on possibly disappearing page,
     but -swiper:pageDidAppear: will be called for the new page. If all page data doesn't actually change underneath,
     the newly appearing page could've actually been the previously already appeared page.
     */
    -(void) reloadData;
    
    
    /**
     Will cause DataSource to be queried if necessary (when the newly inserted page
     needs to be actually inserted to view hierarchy).
     */
    -(void) insertPageAtIndex:(NSInteger)pageIndex;
    -(void) removePageAtIndex:(NSInteger)pageIndex;
    
    @end

    Swift

    @MainActor protocol RichieSwiper : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieSwiperDataSource <NSObject>
    
    /**
     If the number of pages in Swiper changes, call -reloadData to let the know that.
     */
    -(NSInteger) numberOfPagesInSwiper:(id<RichieSwiper>)swiper;
    
    /**
     DataSource is responsible for creating views for pages.
     It can use -[RichieSwiper frameForPageAtIndex:] for creating the view with correct size.
     RichieSwiper itself doesn't use auto layout, but pages can use auto layout internally.
     Note that the returned view will have it's frame set so it's as wide as the swiper view,
     and centered vertically if it's shorter than swiper view.
     */
    -(UIView *) swiper:(id<RichieSwiper>)swiper pageAtIndex:(NSInteger)pageIndex;
    
    
    @optional
    
    /**
     Called after RichieSwiper has removed page view from view hierarchy.
     This is an opportunity for the DataSource to do any necessary tear down (clearing delegates, stopping operations)
     if page view instances aren't recycled or otherwise cached. Also, this method can be used to gather views for
     recycling (manually), similar to how UITableView recycles cell views.
     Views cached for recycling in this call can be later returned by -swiper:pageAtIndex:.
     */
    -(void) swiper:(id<RichieSwiper>)swiper didRemovePage:(UIView *)view atIndex:(NSInteger)pageIndex;
    
    @end

    Swift

    @MainActor protocol RichieSwiperDataSource : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieSwiperDataSourceAdViewPolicy <NSObject>
    
    -(UIView *) viewForSwiper:(id<RichieSwiper>)swiper atIndex:(NSInteger)pageIndex;
    -(void) pageWasRemoved:(__kindof UIView *)view inSwiper:(id<RichieSwiper> __unused)swiper atIndex:(NSInteger)pageIndex isAdPage:(BOOL)isAdPage;
    
    @property (nonatomic, readonly) NSInteger numberOfAdViews;
    
    -(void) pageDidAppear:(NSInteger)pageIndex inSwiper:(id<RichieSwiper>)swiper isAdPage:(BOOL)isAdPage isFirstAppearance:(BOOL)isFirstAppearance;
    -(void) pageDidDisappear:(NSInteger)pageIndex inSwiper:(id<RichieSwiper>)swiper isAdPage:(BOOL)isAdPage;
    
    -(NSInteger) currentPageIndexRestoringAdViewsWhenSettingCurrentPageIndex:(NSInteger)newPageIndex
    												 withNumberOfOriginPages:(NSInteger)numberOfOriginPages;
    
    -(BOOL) isAdIndex:(NSInteger)pageIndex;
    
    -(NSInteger) swiperIndexFromOriginIndex:(NSInteger)originIndex;
    -(NSInteger) originIndexFromSwiperIndex:(NSInteger)swiperIndex;
    
    -(void) willReloadDataWithNumberOfOriginPages:(NSInteger)numberOfOriginPages;
    -(void) didReloadData;
    
    -(void) didInsertPageAtOriginIndex:(NSInteger)originIndex inSwiper:(id<RichieSwiper>)swiper;
    
    @property (nonatomic, readonly) BOOL areAppearanceCallbacksDisabled;
    
    @end

    Swift

    protocol RichieSwiperDataSourceAdViewPolicy : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieSwiperDelegate <NSObject>
    
    @optional
    
    -(void) swiper:(id<RichieSwiper>)swiper pageDidAppear:(NSInteger)pageIndex userGesture:(BOOL)userGesture;
    -(void) swiper:(id<RichieSwiper>)swiper pageDidDisappear:(NSInteger)pageIndex;
    
    /**
     leftPage or rightPage can be -1 if it's not a valid page index, such as when past begin or end of swiper.
     Percentage ([-1, 1]) is the completeness of panning transition from left page to right page. Negative percentage values mean percentage is from rightPage to leftPage, positive percentage values mean distance is from leftPage to rightPage. When a page is invalid (-1), percentage is from the valid page.
     
     For example, leftPage == -1 and rightPage == 0, percentage will be negative (or zero), because panning is from the rightPage to left. When leftPage == <last page index> and rightPage == -1, percentage will be positive (or zero), signifying panning is to right from leftPage.
     
     Also, when leftPage == 1 and rightPage == 2, percentage == 0.75 and percentage == -0.25 are the same thing: panning transition is 75% complete from the left page to the right page.
     */
    -(void) swiper:(id<RichieSwiper>)swiper didPanToPercent:(float)percent betweenPage:(NSInteger)leftPage andPage:(NSInteger)rightPage;
    
    @end

    Swift

    @MainActor protocol RichieSwiperDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieSwiperSlotAdProvider <NSObject>
    
    -(RichieAdsSlotAdFlight *) nextFlight;
    
    -(RichieAdsView *) viewWithFrame:(CGRect)frame forAdFlight:(RichieAdsSlotAdFlight *)slotAdFlight;
    
    @end

    Swift

    @MainActor protocol RichieSwiperSlotAdProvider : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieURLDownloadFactory <NSObject>
    
    -(RichieURLDownload *) downloadToMemory;
    -(RichieURLDownload *) downloadWithoutStoringDataWithByteRangeStart:(int64_t)byteRangeStart;
    -(RichieURLDownload *) downloadToPath:(NSString *)destinationPath;
    
    @end

    Swift

    protocol RichieURLDownloadFactoryProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol RichieURLDownloadQueue <NSObject>
    
    -(void) queueURLDownload:(RichieURLDownload *)download;
    -(void) queueURLDownload:(RichieURLDownload *)download prioritize:(BOOL)shouldPrioritize; //!< Queues the download to be executed when there's available width in the queue. Prioritized downloads are sent to the top of the queue.
    
    //! Cancels downloads which are already in progress and removes all queued downloads so they won't be started. Except that due to an error, downloads in retry delay aren't cancelled.
    -(void) cancelAllDownloads;
    
    @property (nonatomic, readonly, nullable) id<RichieURLDownloadFactory> downloadFactory; //!< Convenience property: users of download queues often (if not always) need a download factory, so that's why they're bundled together.
    
    -(void) invalidate;
    
    @end

    Swift

    protocol RichieURLDownloadQueueProtocol : NSObjectProtocol
  • Protocol that represents a cancelable operation.

    See more

    Declaration

    Swift

    public protocol Cancelable
  • Startable is a protocol that defines a start operation that takes a completion block.

    See more

    Declaration

    Swift

    public protocol Startable<Output, Failure>
  • StartableCancelable combines Startable and Cancelable.

    Declaration

    Swift

    public protocol StartableCancelable<Output, Failure> : Cancelable, Startable
  • Undocumented

    See more

    Declaration

    Swift

    public protocol AudioHostAppEventSink
  • Allows a video player to join an existing Now Playing session, preventing it from affecting control center or lock screen playback controls independently.

    See more

    Declaration

    Swift

    @MainActor
    public protocol NowPlayingSessionProvider : AnyObject
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public protocol RichieAdsNativeAdViewProtocol
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public protocol RichieAdsNativeMultipageViewDelegate
  • RichieOpenLinkDelegate is a delegate protocol for handling clicks on links.

    Set it using setLinkDelegate(_:) for ads or openLinkDelegate for editions.

    See more

    Declaration

    Swift

    @objc
    public protocol RichieOpenLinkDelegate