PVOnboardKit 1.1.3

PVOnboardKit 1.1.3

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布日期上次发布2017年12月

Victor Peschenkov 维护。



  • 作者
  • Victor Peschenkov

PVOnboardKit 是一个框架,可以使您将自定义的引导/简介/教程添加到您的应用中。主要概念使用 UITableView。此外,为了实现更详细的定制,PVOnboardKit 使用 PVOnboardKit 而不是 UIPageControl

Demo!

要求

Xcode 9。适用于 iOS 8 及以上版本。

安装

将以下内容添加到 Podfile 并运行 pod install 即可

pod 'PVOnboardKit'
  1. 导入 PVOnboardKit
  2. 创建 PVOnboardView 并将其添加到您的视图中
  3. 实现 PVOnboardViewDelegatePVOnboardViewDataSource 并将其分配给 PVOnboardView 的实例
  4. PVOnboardView 的实例调用 reloadData
  5. 享受吧😎

代理方法

@optional
/**
 * Invoked after a user did touch on the left action button.
 *
 * @param onboardView The onboardView.
 * @param index The index of the page.
 */
- (void)onboardView:(nonnull PVOnboardView *)onboardView didTouchOnLeftActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Invoked after a user did touch on the right action button.
 *
 * @param onboardView The onboardView.
 * @param index The index of the page.
 */
- (void)onboardView:(nonnull PVOnboardView *)onboardView didTouchOnRightActionButtonAtIndex:(NSInteger)index;

数据源方法

@required
/**
 * Requests a number of pages in current onboardView.
 *
 * @param onboardView The onboard-view object asking for number of pages.
 * @return The number of pages.
 */
- (NSInteger)numberOfPagesInOneboardView:(nonnull PVOnboardView *)onboardView NS_SWIFT_NAME(numberOfPages(in:));
@required
/**
 * Requests a page view for the page at index.
 *
 * @param onboardView The onboard-view object asking for the view.
 * @param index An index of a requested page.
 * @return The view that conforms to PVOnboardPage protocol.
 */
- (nonnull UIView *)onboardView:(nonnull PVOnboardView *)onboardView viewForPageAtIndex:(NSInteger)index NS_SWIFT_NAME(onboardView(_:viewForPageAtIndex:));
@optional
/**
 * Requests a visible state for the right action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the right button
 * visible state.
 * @param index An index of a requested page.
 * @return Return YES if a action button should be visible or NO if shouldn't.
 */
- (BOOL)onboardView:(nonnull PVOnboardView *)onboardView shouldHideRightActionButtonForPageAtIndex:(NSInteger)index;
@optional
/**
 * Requests a title for the right action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the right button title.
 * @param index An index of a requested page.
 * @return The string to use as a title for the right action button.
 */
- (nullable NSString *)onboardView:(nonnull PVOnboardView *)onboardView titleForRightActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests title edge insets for the right action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the right button edge
 * insets.
 * @param index An index of a requested page.
 * @return The edge insets to use as the title edge insets for the right
 * action button.
 */
- (UIEdgeInsets)onboardView:(nonnull PVOnboardView *)onboardView titleEdgeInsetsForRightActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests an image for the right action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the right button image.
 * @param index An index of a requested page.
 * @return The image to use as the image for the right action button.
 */
- (nullable UIImage *)onboardView:(nonnull PVOnboardView *)onboardView imageForRightActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests image edge insets for the right action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the right button image
 * edge insets.
 * @param index An index of a requested page.
 * @return The edge insets to use as the image edge insets for the right
 * action button.
 */
- (UIEdgeInsets)onboardView:(nonnull PVOnboardView *)onboardView imageEdgeInsetsForRightActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests a visible state for the left action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the left button
 * visible state.
 * @param index An index of a requested page.
 * @return Return YES if a action button should be visible or NO if shouldn't.
 */
- (BOOL)onboardView:(nonnull PVOnboardView *)onboardView shouldHideLeftActionButtonForPageAtIndex:(NSInteger)index;
@optional
/**
 * Requests a title for the left action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the left button title.
 * @param index An index of a requested page.
 * @return Return the string that should use as a title.
 */
- (nullable NSString *)onboardView:(nonnull PVOnboardView *)onboardView titleForLeftActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests title edge insets for the left action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the left button edge
 * insets.
 * @param index An index of a requested page.
 * @return The edge insets to use as the title edge insets for the left
 * action button.
 */
- (UIEdgeInsets)onboardView:(nonnull PVOnboardView *)onboardView titleEdgeInsetsForLeftActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests an image for the left action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the left button image.
 * @param index An index of a requested page.
 * @return The image to use as the image for the left action button.
 */
- (nullable UIImage *)onboardView:(nonnull PVOnboardView *)onboardView imageForLeftActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests image edge insets for the left action button for page at index.
 *
 * @param onboardView The onboard-view object asking for the left button image
 * edge insets.
 * @param index An index of a requested page.
 * @return The edge insets to use as the image edge insets for the left
 * action button.
 */
- (UIEdgeInsets)onboardView:(nonnull PVOnboardView *)onboardView imageEdgeInsetsForLeftActionButtonAtIndex:(NSInteger)index;
@optional
/**
 * Requests a bottom padding for the footer view. Default is 0.
 *
 * @param onboardView The onboardView.
 * @return The padding to use as the footer view bottom padding.
 */
- (CGFloat)onboardViewFooterBottomPadding:(nonnull PVOnboardView *)onboardView NS_SWIFT_NAME(onboardViewFooterBottomPadding(paddingForPageAtIndex:));

感谢

感谢 @TanguyAladenise 提供 TAPageControl

社区

问题、评论、问题和拉取请求总是受欢迎!

许可证

在 MIT 许可证下分发。有关更多信息,请参阅 LICENSE。