Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
NewsCubeMenu can use a variety of function buttons that scroll horizontally.
Objective-C
branch: develop

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
NewsCubeMenu.xcodeproj
NewsCubeMenu
LICENSE
README.md

README.md

NewsCubeMenu

screenshot

NewsCubeMenu can use a variety of function buttons that scroll horizontally. This Menu can be customized widely!

  • Base image of the button.
  • Button's image content.
  • The number of buttons...

Everyone can be customized the way you want this menu is possible!
For example, here's how easy it is create NewsCubeMenu!

    NSMutableArray *menus = [NSMutableArray array];
    for (int i = 0; i < 7; i++) {
        NCMenuItem *menuItem = [[NCMenuItem alloc] initWithImage:nc_button_baseImage highlightedImage:nc_button_highlightedBaseImage ContentImage:nc_contentImage highlightedContentImage:nc_contentImage];
        [menus addObject:menuItem];
    }

    _newsCubeMenu = [[NCMenu alloc] initWithFrame:newsCubeMenuPos withBackgroundColor:[UIColor clearColor] menuItems:menus];
    [_newsCubeMenu setDelegate:self];

Please try to see the following sentence has a variety of functions more.

How To Get Started

  • Download NewsCubeMenu and try out the included iPhone example app.
  • Read this Document to check the APIs available in NewsCubeMenu.

How To Include It

  • Copy NCMenuItem.hm and NCMenu.hm file in NewsCubeMenu folder.
  • Add QuartzCore.framework to your project's Link Binary With Libraries build phase.

Example Usage

Create NCMenuItem

    // Base Image
    UIImage *nc_button_baseImage = [UIImage imageNamed:@"nc_button_baseImage.png"];
    UIImage *nc_button_highlightedBaseImage = [UIImage imageNamed:@"nc_button_highlightedImage.png"];

    // ContentImage
    UIImage *nc_contentImage = [UIImage imageNamed:@"nc_contentImage.png"];

    NSMutableArray *menus = [NSMutableArray array];
    for (int i = 0; i < 7; i++) {
        NCMenuItem *menuItem = [[NCMenuItem alloc] initWithImage:nc_button_baseImage highlightedImage:nc_button_highlightedBaseImage ContentImage:nc_contentImage highlightedContentImage:nc_contentImage];
        [menus addObject:menuItem];
    }

Add NCMenuItem to NCMenu and Display Menu.

    CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];
    CGRect newsCubeMenuPos = CGRectMake(0,applicationFrame.size.height, applicationFrame.size.width, 70);
    _newsCubeMenu = [[NCMenu alloc] initWithFrame:newsCubeMenuPos withBackgroundColor:[UIColor clearColor] menuItems:menus];
    [_newsCubeMenu setDelegate:self];
    [_webView addSubview:_newsCubeMenu];

popUpMenuFunction

-(void)popUpNewsCubeMenu{
    NSLog(@"%s",__func__);
    [UIView animateWithDuration:0.2f animations:^{
        CGRect frame = _newsCubeMenu.frame;
        frame.origin.y -= frame.size.height;
        _newsCubeMenu.frame = frame;
    } completion:^(BOOL finished) {

    }];
}

Callback methods when the button was pressed.

  • You are convenient to use an enumerated type.
-(void)newsCubeMenu:(NCMenu *)menu didSelectIndex:(NSInteger)selectedIndex{
    NSLog(@"%s:SelectedIndex:%d",__func__,selectedIndex);
}

Credits

NewsCubeMenu was created by Shota Kondou(@cyclin_devel) in development of NewsCube.

License

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

Something went wrong with that request. Please try again.