MimiPagingProgressCalculator

public struct MimiPagingProgressCalculator

Calculator that is capable of calculating progress values for use in lower/upper paginated transitions.

  • Object that describes the page bounds for a current pagination position.

    Declaration

    Swift

    public struct PageBounds
  • Calculate the page bounds for a current page position.

    Declaration

    Swift

    public static func calculatePageBounds(for position: CGFloat, max: Int) -> PageBounds
    Parameters
    position

    Current page position.

    max

    Maximum page position.

  • Calculate the progress to be used in the lower page of some PageBounds.

    Declaration

    Swift

    public static func calculateLowerProgress(for bounds: PageBounds, position: CGFloat) -> CGFloat
    Parameters
    bounds

    Page bounds.

    position

    Current position.

  • Calculate the progress to be used in the upper page of some PageBounds.

    Declaration

    Swift

    public static func calculateUpperProgress(for bounds: PageBounds, position: CGFloat) -> CGFloat
    Parameters
    bounds

    Page bounds.

    position

    Current position.

  • Calculate the linear progress between pages in some bounds.

    Declaration

    Swift

    public static func calculateProgress(for bounds: PageBounds, position: CGFloat) -> CGFloat
    Parameters
    bounds

    Page bounds.

    position

    Current position.