Latest 2.2
Homepage https://github.com/ChinaHackers/LCSlideMenu
License MIT
Platforms ios 11.2
Frameworks UIKit
Authors

LCSlideMenu

language
Swift  4.0
xcode version
CocoaPods compatible
download
build
platform
https://github.com/ChinaHackers/LCSlideMenu/blob/master/LICENSE
GitHub starts
GitHub fork
Twitter Follow


What is LCSlideMenu?

LCSlideMenu It’s a powerful and easy to use slider menu.

中文 | English

Screencast from our Demo

LCSlideMenu LCSlideMenu LCSlideMenu LCSlideMenu
indicatorType = .stretch titleStyle = .gradient indicatorType = .cover titleStyle = .gradient indicatorType = .stretch titleStyle = .transfrom indicatorType = .normal titleStyle = .transfrom
LCSlideMenu LCSlideMenu LCSlideMenu LCSlideMenu
indicatorType = .cover titleStyle = .gradient isShowIndicatorView = false titleStyle = .transfrom indicatorType = .cover titleStyle = .transfrom isShowIndicatorView = false titleStyle = .gradient

Menu indicator and title style

  • Using enumerations to define LCSlideMenuTitleStyle and LCSlideMenuTitleStyle types

/// Select the menu header style
///
/// - normal: normal
/// - gradient: The gradient color
/// - transfrom: zoom
public enum LCSlideMenuTitleStyle {
    case normal
    case gradient
    case transfrom
}

/// Select the menu indicator style
///
/// - normal: normal
/// - stretch: stretch
/// - followText: Following text length
/// - cover: mask
public enum LCSlideMenuIndicatorStyle {
    case normal
    case stretch
    case followText
    case cover
}

Attribute

Attribute name Specific introduction of attributes
coverView Mask the view
indicatorType LCSlideMenu of indicator type
titleStyle Heading styles
itemFont The font size of the heading
isShowIndicatorView Whether to display the indicator view
isNeedMask Do you need a mask?
coverHeight The height of the mask view
coverColor The background color of the mask view
selectedColor The color in the currently selected state
unSelectedColor The color of the unchecked state
bottomPadding The indicator is at the bottom
indicatorHeight Height of indicator

Requirements

  • iOS 11.2
  • Xcode 9.2
  • Swift 4.0.3+

Installation

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods
  • Just add the LCSlideMenu folder to your project.

  • or add them to your Podfile file to use CocoaPods install LCSlideMenu
platform :ios, '11.2'
target '<Your Target Name>' do
use_frameworks!
pod 'LCSlideMenu'
end

Then, run the following command:

$ pod install

Example:

import UIKit
import LCSlideMenu

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        example()
    }
    fileprivate func example() {

        let titles = ["Apple", "Banana", "Watermelon", "Orange", "Lemon", "Pear","Strawberry", "Sapodilla", "Haw", "Grape","Mango", "Plum", "Persimmon", "Fig", "Betelnut"]
        var controllers: [UIViewController] = []

        for _ in 0 ..< titles.count {
            let vc = UIViewController()
            vc.view.backgroundColor = UIColor(red: CGFloat(arc4random() % 256) / 255, green: CGFloat(arc4random() % 256) / 255, blue: CGFloat(arc4random() % 256) / 255, alpha: 1)
            addChildViewController(vc)
            controllers.append(vc)
        }
        /* -- LCSlideMenu -- */
        let slideMenu = LCSlideMenu(frame: CGRect(x: 0, y: 64, width: view.frame.width, height: 40), titles: titles, childControllers: controllers)
        slideMenu.indicatorType = .cover
        slideMenu.titleStyle = .gradient
        slideMenu.isShowIndicatorView = false
        slideMenu.isNeedMask = true
        slideMenu.coverView.layer.cornerRadius = slideMenu.coverHeight * 0.2
        slideMenu.coverColor = .black
        slideMenu.selectedColor = .white
        slideMenu.unSelectedColor = .black
        slideMenu.indicatorView.backgroundColor = .red
        view.addSubview(slideMenu)
    }
}

Latest podspec

{
    "name": "LCSlideMenu",
    "version": "2.2",
    "summary": "A powerful and easy to use slider menu.",
    "description": "A LCSlide Menu Library Can quickly create a controller with a sliding menu bar.",
    "homepage": "https://github.com/ChinaHackers/LCSlideMenu",
    "screenshots": [
        "https://ws4.sinaimg.cn/large/006tNc79gy1fpjn73intog30be0mib2d.gif",
        "https://ws3.sinaimg.cn/large/006tNc79gy1fpjncsqqs4g30be0mikjn.gif"
    ],
    "license": "MIT",
    "authors": {
        "ChinaHackers": "[email protected]"
    },
    "platforms": {
        "ios": "11.2"
    },
    "source": {
        "git": "https://github.com/ChinaHackers/LCSlideMenu.git",
        "tag": "2.2"
    },
    "source_files": [
        "LCSlideMenu",
        "LCSlideMenu/**/*.{h,m,swift}"
    ],
    "exclude_files": "LCSlideMenu/Exclude",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This