GithubHelp home page GithubHelp logo

zhoulincome / circle-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramotion/circle-menu

0.0 2.0 0.0 3 MB

CircleMenu is a simple, elegant menu with a circular layout.

Home Page: https://business.ramotion.com/gthb-casestudies

License: MIT License

Ruby 1.26% Swift 97.40% Objective-C 1.34%

circle-menu's Introduction

header

CircleMenu

Twitter CocoaPods CocoaPods CocoaPods Carthage compatible codebeat badge Travis

About

This project is maintained by Ramotion, Inc.
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Looking for developers for your project? [▶︎CONTACT OUR TEAM◀︎]

preview

The iPhone mockup available here.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Just add CircleMenuLib folder to your project.

or use CocoaPods with Podfile:

pod 'CircleMenu', '~> 2.0.1' swift 3
pod 'CircleMenu', '~> 1.0.7' swift 2

or Carthage users can simply add to their Cartfile:

github "Ramotion/circle-menu"

Usage

with storyboard
  1. Create a new UIButton inheriting from CircleMenu

  2. Add images for Normal and Selected state

  3. Use delegate method to configure buttons

func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
  1. Use properties to confiure CircleMenu
@IBInspectable var buttonsCount: Int = 3
@IBInspectable var duration: Double = 2 // circle animation duration
@IBInspectable var distance: Float = 100 // distance between center button and buttons
programmatically
let button = CircleMenu(
  frame: CGRect(x: 200, y: 200, width: 50, height: 50),
  normalIcon:"icon_menu",
  selectedIcon:"icon_close",
  buttonsCount: 4,
  duration: 4,
  distance: 120)
button.delegate = self
button.layer.cornerRadius = button.frame.size.width / 2.0
view.addSubview(button)
delegate methods
// configure buttons
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)

// call before animation
optional func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int)

// call after animation
optional func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int)

// call upon cancel of the menu
optional func menuCollapsed(circleMenu: CircleMenu)

Licence

Circle menu is released under the MIT license. See LICENSE for details.

Folow us

Twitter URL Twitter Follow

circle-menu's People

Contributors

0ber avatar aleksei1000000 avatar artemkyslicyn avatar juriv avatar pdenya avatar sairamkotha avatar skywinder avatar tache avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.