Latest 0.1.6
Homepage https://github.com/mateuszfidosBLStream/MFCircleMenu
License MIT
Platforms ios 8.0
Authors

Build Status
Version
License
Platform

Example

To run the example project, clone the repo, open and run Example scheme.

Requirements

ARC
iOS8

Installation

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

pod "MFCircleMenu"

Usage

Now you can define wheter you want your menu to adjust to your devices orientation. There is a new property in initializer method:

adjustToOrientation:Bool

Setting this property to be true will automatically adjust your "other items" to be laid out accordingly to orientation of your device. Setting this to be false will prevent rotation and adjusting.

NOTE:
Even if you set this property to be false if there are too many elements in menu and collision will be detected after roatation, items position will be changed to prevent from colliding with screens edge.

import MFCircleMenu

Item action definition:

let mainAction: MainItemActionClosure = {
  if (self.menu.menuState == .Closed)
  {
    self.presenter.openMenu()
  }
  else
  {
    self.presenter.closeMenu()
  }
}

let itemOneAction: ItemActionClosure = {
  print("Item One tapped")
  let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("nextViewController")
  self.presentViewController(controller, animated: true, completion: nil)
}

let itemTwoAction: ItemActionClosure = {
  print("Item Two tapped")
}

Create menu items:
(You can also use convenience initializers for items – some values are optional)

let mainCircle = MFCircleMenuMainItem(action: mainAction, closedStateImage: UIImage(named: "settings")!, openedStateImage: UIImage(named: "soundon")!, text: nil, backgroundColor: UIColor.redColor())
let itemOne = MFCircleMenuOtherItem(action: itemOneAction, image: UIImage(named: "soundon")!, text: "Item One", backgroundColor: nil)
let itemTwo = MFCircleMenuOtherItem(action: itemTwoAction, image: UIImage(named: "soundoff")!, text: nil, backgroundColor: UIColor.blueColor())

Create menu component and define position on screen where you want menu to show up

let menu = MFCircleMenu(mainItem: mainCircle, otherItems: [itemOne, itemTwo], parent: self.view, adjustToOrientation: false)
menu.showAtPosition(MFCircleMenuPosition.TopLeft)

Annotation

This is still WIP
UITests to be added soon

Author

Mateusz Fidos, [email protected]

License

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

Latest podspec

{
    "name": "MFCircleMenu",
    "version": "0.1.6",
    "summary": "Small, on screen, popping out circle menu.",
    "description": "This is a small, on screen, menu-like component. For you, to use on any screen that you want in your app. Not much of a Navigation-Controller-Menu-Sliding-Off-Of-The-Screen but more of a - small - here you have some options - kind of menu.",
    "homepage": "https://github.com/mateuszfidosBLStream/MFCircleMenu",
    "license": "MIT",
    "authors": {
        "Mateusz Fidos": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mateuszfidosBLStream/MFCircleMenu.git",
        "tag": "0.1.6"
    },
    "social_media_url": "https://twitter.com/@mateuszfidos",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MFCircleMenu/**/*"
}

Pin It on Pinterest

Share This