Latest 0.4.0
Homepage https://github.com/marty-suzuki/MartyJunior
License MIT
Platforms ios 8.0, requires ARC
Dependencies MisterFusion
Frameworks UIKit
Authors

[![CI Status](http://img.shields.io/travis/Taiki Suzuki/MartyJunior.svg?style=flat)](https://travis-ci.org/Taiki Suzuki/MartyJunior)
Version
License
Platform

MartyJunior

You can change tab contents with swipe gesture on middle of UITableView!!

Features

  • [x] Change tab middle of UITableView.
  • [x] Be able to scroll smoothly without two step.
  • [x] Auto fill content space when content size is not enough.
  • [x] Flexible and customizable top content.
  • [x] Customizable tab view.
  • [x] Navigation view.
  • [x] Support Swift3 (If you want to use it in Swift3

Installation

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

  pod "MartyJunior"

Usage

If you install from cocoapods, You have to write import MartyJunior.

Life cycle

viweDidLoad -> viewWillSetupForMartyJunior -> viewDidSetupForMartyJunior

You have to setup delegate, dataSource and so on in viewWillSetupForMartyJunior like this.

override func viewWillSetupForMartyJunior() {
    super.viewWillSetupForMartyJunior()
    delegate = self
    dataSource = self
    registerNibToAllTableViews(ProfileTweetCell.nib, forCellReuseIdentifier: ProfileTweetCell.ReuseIdentifier)
    registerNibToAllTableViews(ProfileUserCell.nib, forCellReuseIdentifier: ProfileUserCell.ReuseIdentifier)

    tabView.delegate = self

    title = "@szk-atmosphere"
}

You have to setup NavigationView and so on in viewDidSetupForMartyJunior like this.

override func viewDidSetupForMartyJunior() {
    super.viewDidSetupForMartyJunior()
    navigationView?.titleLabel.alpha = 0
    navigationView?.rightButton = UIButton(type: .InfoDark)
    navigationView?.rightButton?.tintColor = .white
}

Specific dataSource methods

// Return number of tabs
func mjViewControllerNumberOfTabs(viewController: MJViewController) -> Int

// Return UIView you want to display as top content
func mjViewControllerContentViewForTop(viewController: MJViewController) -> UIView

// Return TabView if you want to display as custom view
optional func mjViewControllerTabViewForTop(viewController: MJViewController) -> UIView

Other dataSource methods

Protocol based on UITableViewDataSource. It has targetIndex parameter to assign applicable tableView.

  • Example
    optional func mjViewController(viewController: MJViewController, targetIndex: Int, numberOfSectionsInTableView tableView: UITableView) -> Int

Specific delegate methods

// Celled when selected tab index was changed
optional func mjViewController(viewController: MJViewController, didChangeSelectedIndex selectedIndex: Int)

Other delegate methods

Protocol based on UITableViewDelegate. It has targetIndex or selectedIndex parameter to assign applicable tableView.

  • Example
    optional func mjViewController(viewController: MJViewController, targetIndex: Int, tableView: UITableView, didSelectRowAtIndexPath indexPath: IndexPath)
    optional func mjViewController(viewController: MJViewController, selectedIndex: Int, scrollViewDidScroll scrollView: UIScrollView)

Requirements

  • Xcode 8 or greater
  • iOS 8.0 or greater
  • MisterFusion (Swift DSL for AutoLayout)
  • UIKit

Other

A sample of this project uses

Author

Taiki Suzuki, [email protected]

License

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

Latest podspec

{
    "name": "MartyJunior",
    "version": "0.4.0",
    "summary": "You can change tab contents with swipe gesture on middle of UITableView!!",
    "homepage": "https://github.com/marty-suzuki/MartyJunior",
    "license": "MIT",
    "authors": {
        "Taiki Suzuki": "[email protected]"
    },
    "source": {
        "git": "https://github.com/marty-suzuki/MartyJunior.git",
        "tag": "0.4.0"
    },
    "social_media_url": "https://twitter.com/marty_suzuki",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "MartyJunior/*.{swift}",
    "frameworks": "UIKit",
    "dependencies": {
        "MisterFusion": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This