• Stars
    star
    262
  • Rank 156,136 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pull down menu, similar to notification center on iOS that supports an unlimited number of items. Items can either be selected, deleted or reordered. The control is aimed at providing context for switching data within the same view controller.

#Introduction

A pull down menu, similar to notification center on iOS that supports an unlimited number of items. Items can either be selected, deleted or reordered. The control is aimed at providing context for switching data within the same view controller.

by @mmackh

#Live Demo

#Example Usage

- (IBAction)togglePullDownMenu:(id)sender
{
    [self.pullDownMenuButton setSelected:!self.pullDownMenuButton.selected];
    BOOL menuVisible = self.pullDownMenuButton.selected;
    
    if (menuVisible)
    {
        self.searchBar.text = @"";
        [self.searchBar resignFirstResponder];
        
        __weak typeof(self) weakSelf = self;
        KEYPullDownMenuItem *activeMenu = [KEYPullDownMenuItem menuItemNamed:@"HP Restaurant" deletable:NO];
        [activeMenu setActive:YES];
        
        NSMutableArray *pullDownItems = [NSMutableArray new];
        for (PCSmartOrderTableStation *tableStation in self.controller.currentVenue.tableStations)
        {
            KEYPullDownMenuItem *item = [KEYPullDownMenuItem menuItemNamed:tableStation.name deletable:NO];
            [item setActive:(_currentTableStation == tableStation)];
            [pullDownItems addObject:item];
        }
        
        KEYPullDownMenu *pullDownMenu = [KEYPullDownMenu openMenuInViewController:self items:pullDownItems
         dismissBlock:^(KEYPullDownMenuItem *selectedItem, NSInteger selectedRow)
         {
             PCSmartOrderTableStation *temporaryTableStation = weakSelf.controller.currentVenue.tableStations[selectedRow];
             if (temporaryTableStation != _currentTableStation)
             {
                 _currentTableStation = temporaryTableStation;
                 weakSelf.controller.currentVenue.currentTableStation = _currentTableStation;
                 
                 [weakSelf.collectionView setContentOffset:CGPointZero];
                 [weakSelf updateView];
             };
             [weakSelf togglePullDownMenu:nil];
         }
         reorderBlock:nil deleteBlock:nil];
        pullDownMenu.backgroundColor = [UIColor colorWithWhite:0.3 alpha:0.95];
    }
    else
    {
        [KEYPullDownMenu dismissInViewController:self];
    }
}

#Attribution

##SKBounceAnimation

Copyright (c) 2012 Soroush Khanlou (http://khanlou.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

##BVReorderTableView Created by Benjamin Vogelzang on 3/5/13. Copyright (c) 2013 Ben Vogelzang.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

Hacker-News-for-iOS

Hacker News client for iPad and iPhone [DEPRECATED]
Objective-C
588
star
2

MAImagePickerController-of-InstaPDF

Fully customizable UIImagePicker replacement with flexible cropping, filters, perspective correction, rotation etc.
C++
516
star
3

BaseComponents

BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Swift
141
star
4

Catalyst-Helpers

Unlock missing UIKit functionality with these AppKit helpers
Objective-C
107
star
5

PCRapidSelectionView

Interactive, beautiful & fast UIActionSheet replacement, supports continuous hold & select
Objective-C
67
star
6

Clear-Read-API

Extracts article text and metadata from a given URL
PHP
35
star
7

PCSplitView

Super powerful layout for iOS, simplified.
Objective-C
24
star
8

Editor

Custom UIKit Text Editor Component for Catalyst
Swift
16
star
9

Next-Airport

Open source RFML (RedFoundry.com) iPhone app
14
star
10

MStaff

3rd Party WhenIWork.com iOS Client app with multiple account support built for Hotel Marietta, Obertauern
Objective-C
6
star
11

Broadcast.io

Demo Node.js + iOS app that is entirly based on MessagesTableViewController & socket.IO-objc
Objective-C
6
star
12

wrrrite

Start writing, effortlessly & distraction free.
PHP
5
star
13

p-body

Static Blog + PHP + Markdown + CSS Formatting
PHP
4
star
14

Preview

Open Source replacement for RedFoundry Visualizer written in RFML
3
star
15

MMFatPipe

Image Resize + Asynchronous Upload
Objective-C
3
star
16

The-Queue

A ultra light-weight (& basic) Blogging engine: 57kb
PHP
2
star
17

InterfaceBuilder.swift-Demo

Swift
2
star
18

RFMLight

A proposition for a new RFML Format
JavaScript
1
star