PagedMediaDataSource
public protocol PagedMediaDataSource : AnyObject
Data source for providing media items and original views for transition animations.
-
Number of items to be presented.
Declaration
Swift
func numberOfItems(in pagedMediaViewController: PagedMediaViewController) -> Int
-
presentationViewInsets(for:
Default implementation) Adds insets on
PagedMediaViewController
‘s view presentation frame. Defaults to.zero
. Useful for preventing presentation over promotional content.Default Implementation
Declaration
Swift
func presentationViewInsets(for pagedMediaViewController: PagedMediaViewController) -> UIEdgeInsets
-
Provides the media item view for the given index.
Declaration
Swift
func pagedMediaViewController(_ pagedMediaViewController: PagedMediaViewController, pagedMediaViewForItemAt index: Int) -> PagedMediaItem
-
Provides the original view for the given index. Used for transition animations.
Declaration
Swift
func pagedMediaViewController(_ pagedMediaViewController: PagedMediaViewController, originalViewForItemAt index: Int) -> UIView
-
pagedMediaViewController(_:
Default implementationtransitionImageForItemAt: ) Optional method for specifying the original image for the view or a snapshot. By default
PagedMediaTransitionDriver
will create a snapshot from the original view.Default Implementation
Declaration
Swift
func pagedMediaViewController(_ pagedMediaViewController: PagedMediaViewController, transitionImageForItemAt index: Int) -> UIImage?