GithubHelp home page GithubHelp logo

khalidelsayed / diymenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dongle/diymenu

0.0 1.0 0.0 60 KB

A lightweight, nicely animated modal menu intended to drop below a titlebar of some sort

Home Page: https://github.com/dongle/diymenu

License: Other

diymenu's Introduction

DIYMenu

It's a modal menu that looks OK. It's a singleton and it'll send strings to a delegate based on what selections the user makes.

Getting Started

#import "DIYMenu.h"

Setup:

UIFont *font = [UIFont fontWithName:@"Helvetica-Neue" size:32];

// Set the delegate
[DIYMenu setDelegate:self];

// Add menu items
[DIYMenu addMenuItem:@"Portfolio" withIcon:[UIImage imageNamed:@"[email protected]"] withColor:[UIColor colorWithRed:0.18f green:0.76f blue:0.93f alpha:1.0f] withFont:font];
[DIYMenu addMenuItem:@"Skills" withIcon:[UIImage imageNamed:@"[email protected]"] withColor:[UIColor colorWithRed:0.28f green:0.55f blue:0.95f alpha:1.0f] withFont:font];

Use:

[DIYMenu show];

Then implement the delegate methods and do stuff I guess.

PS โ€“ Link these bad babies:

QuartzCore.framework
CoreGraphics.framework

Methods

//
// Show / dismiss / check status
//
+ (void)show;
+ (void)dismiss;
+ (BOOL)isActivated;

//
// Setup
//
+ (void)setDelegate:(NSObject<DIYMenuDelegate> *)delegate;

+ (void)addMenuItem:(NSString *)name withIcon:(UIImage *)image withColor:(UIColor *)color withFont:(UIFont *)font;
// Alternately, use a glyph instead of a UIImage
+ (void)addMenuItem:(NSString *)name withGlyph:(NSString *)glyph withColor:(UIColor *)color withFont:(UIFont *)font withGlyphFont:(UIFont *)glyphFont;

Delegate Methods

@protocol DIYMenuDelegate <NSObject>
@required
- (void)menuItemSelected:(NSString *)action;
@optional
- (void)menuActivated;
- (void)menuCancelled;
@end

Configuration

DIYMenuOptions.h holds some config options so you can set the default font and some sizes and stuff.

iOS Support

DIYMenu is tested on iOS 5 and up.

ARC

DIYMenu as of v0.2.0 is built using ARC. If you are including DIYMenu in a project that does not use Automatic Reference Counting (ARC), you will need to set the -fobjc-arc compiler flag on all of the DIYMenu source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. Now select all DIYMenu source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for DIYMenu.

LICENSE

Copyright 2012 DIY, Co.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

diymenu's People

Contributors

dongle avatar thisandagain avatar

Watchers

 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.