Latest 0.0.5
Homepage https://github.com/Jintao1997/TJUIPageView
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit

Install

pod "TJUIPageView" 

Swift-Version

4.2

Getting Started

TJUIPageView

let pageView = TJUIPageView(frame: CGRect(x: 0, y: 20, width: view.jt_width, height: view.jt_height-20))
pageView.dataSource = self
view.addSubView(pageView)

TJUIPageViewDataSource

  • return the count of pages
    func numberOfPages(in pageTab: TJUIPageView) -> Int
  • reutn UIView or UIViewController for each page
    func pageTab(_ pageTab: TJUIPageView, elementForPageAt pageNumber: Int) -> TJUIPageViewElement
  • return title for each pageTabBar Item
    func pageTab(_ pageTab: TJUIPageView, titleForPageViewTabBarPageAt pageNumber: Int) -> String
  • return pageTabBar Height
    func tarBarHeightFor(_ pageTab: TJUIPageView) -> CGFloat

Setting

  • set pageTabBar’s width (default is TJUIPageView’s width)
    TJUIPageView.setTabBarWidth(_ width: CGFloat)
  • set width for pageTabBat’s itemButton (default is UIScreen.width/6)
    TJUIPageView.pageTabBar.setBarItemWidth(_ width: CGFloat)
  • set color and font for pageTabBat’s itemButton
    TJUIPageView.pageTabBar.setItemTextColor(_ color: UIColor, for state: ItemType)
    TJUIPageView.pageTabBar.setItemTextFont(_ font: UIFont, for state: ItemType)
  • pageTabBar show underLine and set underLine’s color or height
    TJUIPageView.pageTabBar.showUnderLine = Bool
    TJUIPageView.pageTabBar.setUnderLineViewHeight(_ height)
    TJUIPageView.pageTabBar.setUnderLineViewColor(_ color: UIColor)
  • change itemButton’s color gradiently when scrolling page

    TJUIPageView.pageTabBar.setItemColorIsGradient(_ isEnable: Bool)

    TJUIPageViewDelegate(TJUIPageView can use these API)

  • reload page UIView and Data
    func reloadPage()
  • insert new page at range of pages
    func insertPage(at page: Int)
  • remove a page
    func removePage(at page: Int)
  • scroll to a page
    func scrollToPage(_ page: Int)
  • move one page to someplace
    func move(at sourcePage: Int, to destinationPage: Int)

Examples(demo)

Insert One Page

Insert One Page

Delete One Page

Delete One Page

Scroll To One Page

Scroll To One Page

Move One Page To Index

Move One Page To

Latest podspec

{
    "name": "TJUIPageView",
    "version": "0.0.5",
    "summary": "TJUIPageViewku6846u67b6",
    "description": "u5934u6761,u65b0u6d6a,u817eu8bafu7b49u65b0u95fbu5ba2u6237u7aefu9996u9875u6846u67b6u5c01u88c5",
    "homepage": "https://github.com/Jintao1997/TJUIPageView",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": "tannerjin",
    "social_media_url": "https://jintao1997.github.io/",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Jintao1997/TJUIPageView.git",
        "tag": "0.0.5"
    },
    "source_files": [
        "TJPageViewDemo/TJPageView/TJPageView/*.swift",
        "TJPageViewDemo/TJPageView/TJPageView/**/*.swift"
    ],
    "frameworks": "UIKit",
    "requires_arc": true,
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This