Coder Social home page Coder Social logo

yippeeapp / kycirclemenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kjuly/kycirclemenu

0.0 3.0 0.0 795 KB

An iOS UI control that allows you to build a circular menu by laying out buttons in a circle pattern adjusting from the number of buttons (1~6).

License: MIT License

Ruby 2.81% Objective-C 97.19%

kycirclemenu's Introduction

KYCircleMenu

A circle menu with toggling animation. And you can customize the number of buttons between (1 ~ 6).

This control is separated from iPokeMon (a PokéMon game on iOS with Location Based Service), you can take a look at the demo video how cool it is!

Usage

Designated Initializer

Use the designated initializer below to initialize the circle menu:

// |buttonCount| : count of buttons around (1<= x <=6)
// |menuSize| : size of menu
// |buttonSize| : size of buttons around
// |buttonImageNameFormat| : name format for button image
// |centerButtonSize| : size of center button
// |centerButtonImageName| : name for center button image
// |centerButtonBackgroundImageName| : name for center button background image
- (id)      initWithButtonCount:(NSInteger)buttonCount
                       menuSize:(CGFloat)menuSize
                     buttonSize:(CGFloat)buttonSize
          buttonImageNameFormat:(NSString *)buttonImageNameFormat
               centerButtonSize:(CGFloat)centerButtonSize
          centerButtonImageName:(NSString *)centerButtonImageName
centerButtonBackgroundImageName:(NSString *)centerButtonBackgroundImageName;

Button Action

Override the -runButtonActions: message to customize your button action:

- (void)runButtonActions:(id)sender {
  [super runButtonActions:sender];

  // Do buttons' action appropriately by |[sender tag]|
  // ...
}

Tags are defined like below:

TAG:        1       1   2      1   2     1   2     1 2 3     1 2 3
           \|/       \|/        \|/       \|/       \|/       \|/
COUNT: 1) --|--  2) --|--   3) --|--  4) --|--  5) --|--  6) --|--
           /|\       /|\        /|\       /|\       /|\       /|\
TAG:                             3       3   4     4   5     4 5 6

Navigation Bar

The default case is that the navigation bar is only shown in child views. If you want it to be shown with the circle menu together, add the macro below

#define KY_CIRCLEMENU_WITH_NAVIGATIONBAR 1

to your constatns.h or config.h, or any other files that are imported in your <Project>-Prefix.pch.


License

This code is distributed under the terms and conditions of the MIT license.

kycirclemenu's People

Contributors

kjuly avatar macbuildserver avatar

Watchers

Chew Chit Siang avatar James Cloos 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.