Skip to content

ziyincody/MTablesView

Repository files navigation

MTablesView

CI Status Version License Platform

A customized view that contains two tableviews. It allows customized segue between the views. By using this view, it enables similar functionality as a viewcontroller but with any frame size.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Need project > iOS 9.0 for NSLayoutAnchor to work

Installation

MTablesView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MTablesView"

Implementation

    var sectionTitles = ["ABC", "BCD", "CDE"]

    var mainData = [["ABC","BCD","CDE"],["ABC","BCD","CDE"]]
    var detailedData = [[["ABC","ABC"],["BCD","BCD"],["CDE","CDE"]],[["ABC","ABC"],["BCD","BCD"],["CDE","CDE"]]]

    lazy var mainView:MTablesView = {
        let mTable = MTablesView(viewTitle: "Hi", sectionTitles: self.sectionTitles, mainData: self.mainData, detailedData: self.detailedData)
            mTable.delegate = self
            mTable.selectingOption = true
            mTable.segueDirection = .top
            return mTable
    }()

ScreenShots

mTable.segueDirection = .top

Top Segue

mTable.segueDirection = .right

Right Segue

Author

ziyinw1011@gmail.com

License

MTablesView is available under the MIT license. See the LICENSE file for more info.