Latest 0.1.0
Homepage https://github.com/dobnezmi/SwiftySlideMenu
License MIT
Platforms ios 8.0, requires ARC
Authors

Cocoapods Compatible
Carthage compatible

Slide animation menu written in Swift.
SwiftySlideMenu is using SwiftyGestureRecognition.

DEMO GIF

Installation

Carthage

To integrate SwiftySlideMenu into your Xcode project using Carthage, specify it in your Cartfile:

github "dobnezmi/SwiftySlideMenu"

Run carthage update to build the framework and drag the built SwiftySlideMenu.framework into your Xcode project.

CocoaPods

use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftySlideMenu'
end

Then, run the following command:
$ pod install

Usage

class YourViewController: UIViewController, SwiftySlideMenuDataSource  {
  var slideMenu: SwiftySlideMenu?

  override func viewDidLoad() {
        super.viewDidLoad()
        slideMenu = SwiftySlideMenu(ownerView: self.view)
        slideMenu?.dataSource = self
    }

    // SwiftySlideMenuDataSource
    func numberOfSwiftySlideMenu() -> Int {
        return 5
    }

    func swiftySlideMenu(menu: SwiftySlideMenu, colorForIndex: Int) -> UIColor {
        let alpha: CGFloat = (255 - (CGFloat(colorForIndex) * 10)) / 255
        return UIColor(red: 0, green: 0, blue: 0, alpha: alpha)
    }

    func swiftySlideMenu(menu: SwiftySlideMenu, viewForIndex: Int) -> UIView {
        let view = UIView(frame: CGRect(x: 20, y: 10, width: 300, height:  60))
        let label = UILabel()
        label.text = "SAMPLE (viewForIndex)"
        label.sizeToFit()
        label.textColor = UIColor.whiteColor()
        view.addSubview(label)
        view.backgroundColor = UIColor.clearColor()
        return view
    }

    func swiftySlideMenu(menu: SwiftySlideMenu, didSelectRowAtIndex: Int) {
        slideMenu.close()
    }

    func swiftySlideMenu(menu: SwiftySlideMenu, heightForIndex: Int) -> CGFloat {
        return 80
    }
}

License

MIT license. See the LICENSE file for details.

Latest podspec

{
    "name": "SwiftySlideMenu",
    "version": "0.1.0",
    "summary": "Slide animation menu for iOS",
    "description": "- Slide animation menu written in Swift",
    "homepage": "https://github.com/dobnezmi/SwiftySlideMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Shingo Suzuki": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/dobnezmi/SwiftySlideMenu.git",
        "tag": "v0.1.0"
    },
    "source_files": "SwiftySlideMenu/**/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This