This is a segment titleView and pageView menu.
IMSegmentPageView is a Swift library that provides a customizable segment titleView and pageView menu.
- iOS 9.0+
- Swift 4.2+
Drop in the Classes folder to your Xcode project.
Using Cocoapods
Add pod 'IMSegmentPageView'
to your Podfile
and run pod install
. Also add use_frameworks!
to the Podfile
.
use_frameworks!
pod 'IMSegmentPageView'
Using Carthage
Add github "iMazy/IMSegmentPageView"
to your Cartfile
and run carthage update
. If unfamiliar with Carthage then checkout their Getting Started section.
github "iMazy/IMSegmentPageView"
Import IMSegmentPageView
import IMSegmentPageView
then use the following codes in some function except for viewDidLoad.
let property = IMSegmentTitleProperty()
property.indicatorHeight = 3
property.indicatorType = .width
property.isLeft = false
property.showBottomLine = true
let titles = ["首页", "电影", "影院", "演出", "MV", "榜单", "热点", "商城"]
let titleFrame = CGRect.zero # set what you need
let titleView = IMSegmentTitleView(frame: titleFrame, titles: titles, property: property)
titleView.delegate = self # if need, you should implement delegate methods
view.addSubview(titleView)
var childVCs: [UIViewController] = [] // viewControllers
let contentFrame = CGRect.zero # set what you need
let pageView = IMPageContentView(Frame: contentFrame, childVCs: childVCs, parentVC: self)
pageView.delegate = self # if need, you should implement delegate methods
view.addSubview(pageView!)
iMazy
http://imazy.cn
Your can feedback me with email mazy_ios@163.com
XMAlertSheetController is released under the MIT license.
See LICENSE for details.