Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

PagerKit

bởi szpakkamil

iOS & macOS Development
1.7kLượt tải do clawskills.sh công bố
1Sao
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Expert guidance on PagerKit, a SwiftUI library for advanced.

Mô tả

Kỹ năng này làm gì

PagerKit is a SwiftUI library for building page-based navigation across iOS, iPadOS, macOS, tvOS, visionOS, and watchOS. It provides PKPagesView and PKPage components with modifiers for controlling indicators, transitions, and event callbacks. Pages can be defined statically or generated dynamically from data collections.

PagerKit replaces UIPageViewController boilerplate with a declarative SwiftUI API that works consistently across all Apple platforms without platform-specific branching for core paging logic.

Khi nào nên dùng

  • Building swipeable onboarding screens in an iOS app
  • Adding a vertical story-style reader to a content app
  • Creating an auto-advancing photo slideshow with custom dot indicators
  • Implementing a multi-step form with programmatic page control
  • Tracking swipe direction for analytics in a tutorial walkthrough

Quy trình ví dụ

ĐẦU VÀO

User asks: How do I build a horizontal onboarding flow with custom indicator colors and detect when the user swipes forward?

AGENT
  1. 1

    Wrap onboarding screens in PKPagesView with individual PKPage instances

  2. 2

    Apply .pkPageNavigationOrientation(.horizontal) for swipe direction

  3. 3

    Bind page state using .pkCurrentPageIndex(index: $currentPage)

  4. 4

    Set .pkPageControlIndicatorTintColor(.gray) and .pkPageControlIndicatorCurrentIndicatorTintColor(.blue) for styled dots

  5. 5

    Add .pkOnManualPageChange { index, direction in ... } to detect forward swipes

ĐẦU RA

A SwiftUI onboarding view with branded dot indicators that reports swipe direction on each page change

Cài đặt

clawhub install szpakkamil/pagerkit

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết