MimiPagingScrollHandler

@MainActor
public final class MimiPagingScrollHandler : NSObject, UIScrollViewDelegate

Object which observes scroll view events, interprets them and reports them to a delegate.

  • Axis of scroll direction.

    Declaration

    Swift

    public enum Axis : Int
  • Scroll view that the handler is responding to.

    Declaration

    Swift

    @MainActor
    public let scrollView: UIScrollView
  • Current page index.

    Declaration

    Swift

    @MainActor
    public var currentIndex: Int { get }
  • Current page position.

    Declaration

    Swift

    @MainActor
    public var currentPosition: CGFloat { get }
  • Whether a parallax transition is enabled when scrolling between pages.

    Declaration

    Swift

    @MainActor
    public var isParallaxEnabled: Bool { get set }
  • Alpha value to use on pages that are unfocussed (not the current).

    Declaration

    Swift

    @MainActor
    public var unfocussedAlpha: CGFloat { get set }
  • Scale value to use on pages that are unfocussed (not the current).

    Declaration

    Swift

    @MainActor
    public var unfocussedScale: CGFloat { get set }
  • Minimum spacing that will be applied between views during transitions.

    Declaration

    Swift

    @MainActor
    public var viewMinimumSpacing: CGFloat { get set }
  • Create a new paging scroll handler.

    Note

    This will override the delegate of the provided scrollView.

    Declaration

    Swift

    @MainActor
    public init(scrollView: UIScrollView, axis: Axis)
    Parameters
    scrollView

    Scroll view to handle/

    axis

    Axis of scroll direction.

  • Update the current transition state.

    Declaration

    Swift

    @MainActor
    public func setNeedsTransitionUpdate()
  • Find a view that is active in transition at a specified location if it exists.

    Declaration

    Swift

    @MainActor
    public func viewInTransition(at location: CGPoint, in referenceView: UIView) -> UIView?
    Parameters
    location

    Location to look for view.

    referenceView

    View to use as a reference for converting the coordinate space.

    Return Value

    View that is being transitioned if found.