Skip to content

Commit

Permalink
WBoCs Pods
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericJacobs committed Jan 24, 2015
1 parent 59375fc commit a5b5acb
Show file tree
Hide file tree
Showing 83 changed files with 15,362 additions and 13,508 deletions.
24 changes: 24 additions & 0 deletions APDropDownNavToolbar/Classes/APNavigationController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// APNavigationController.h
// DropDownToolBar
//
// Created by Ankur Patel on 2/24/14.
// Copyright (c) 2014 Encore Dev Labs LLC. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface APNavigationController : UINavigationController

@property (nonatomic, strong) UIToolbar *dropDownToolbar; // Reference to dynamically change items based on which bar button item is clicked
@property (nonatomic, strong) NSString *activeNavigationBarTitle; // Navigation bar title when the toolbar is shown
@property (nonatomic, strong) NSString *activeBarButtonTitle; // UIBarButton title when toolbar is shown
@property (nonatomic, assign) BOOL isDropDownVisible;

- (void)setActiveBarButtonTitle:(NSString*)title;
- (void)setActiveNavigationBarTitle:(NSString*)title;
- (void)toggleDropDown:(id)sender;
- (void)hideDropDown:(id)sender;
- (void)showDropDown:(id)sender;

@end
108 changes: 108 additions & 0 deletions APDropDownNavToolbar/Classes/APNavigationController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//
// APNavigationController.m
// DropDownToolBar
//
// Created by Ankur Patel on 2/24/14.
// Copyright (c) 2014 Encore Dev Labs LLC. All rights reserved.
//

#import "APNavigationController.h"

@interface APNavigationController ()

@property (nonatomic, copy) NSString *originalNavigationBarTitle;
@property (nonatomic, copy) NSString *originalBarButtonTitle;

@end

@implementation APNavigationController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.dropDownToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 66)];
self.dropDownToolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.dropDownToolbar.tintColor = self.navigationBar.tintColor;
[self.navigationBar.superview insertSubview:self.dropDownToolbar belowSubview:self.navigationBar];
self.originalNavigationBarTitle = self.navigationBar.topItem.title;
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)toggleDropDown:(id)sender
{
if (self.isDropDownVisible) {
[self hideDropDown:sender];
} else {
[self showDropDown:sender];
}
}

- (void)hideDropDown:(id)sender
{
if(self.isDropDownVisible){
__weak APNavigationController *weakSelf = self;
CGRect frame = self.dropDownToolbar.frame;
frame.origin.y = CGRectGetMaxY(self.navigationBar.frame);
self.dropDownToolbar.frame = frame;
[UIView animateWithDuration:0.25 animations:^{
CGRect frame = self.dropDownToolbar.frame;
frame.origin.y = 0.;
weakSelf.dropDownToolbar.frame = frame;
} completion:^(BOOL finished) {
weakSelf.isDropDownVisible = !weakSelf.isDropDownVisible;
weakSelf.dropDownToolbar.hidden = YES;
}];
if (self.activeNavigationBarTitle) {
self.navigationBar.topItem.title = self.originalNavigationBarTitle;
}
if(sender && [sender isKindOfClass:[UIBarButtonItem class]]){
[(UIBarButtonItem *)sender setTitle:self.originalBarButtonTitle];
}

}
}

- (void)showDropDown:(id)sender
{
if(!self.isDropDownVisible){
__weak APNavigationController *weakSelf = self;
CGRect frame = self.dropDownToolbar.frame;
frame.origin.y = 0.f;
self.dropDownToolbar.hidden = NO;
self.dropDownToolbar.frame = frame;
[UIView animateWithDuration:0.25 animations:^{
CGRect frame = self.dropDownToolbar.frame;
frame.origin.y = CGRectGetMaxY(self.navigationBar.frame);
weakSelf.dropDownToolbar.frame = frame;
} completion:^(BOOL finished) {
weakSelf.isDropDownVisible = !weakSelf.isDropDownVisible;
}];
if (self.activeNavigationBarTitle) {
self.navigationBar.topItem.title = self.activeNavigationBarTitle;
}
if(sender && [sender isKindOfClass:[UIBarButtonItem class]]){
self.originalBarButtonTitle = [(UIBarButtonItem *)sender title];
if (self.activeBarButtonTitle) {
[(UIBarButtonItem *)sender setTitle:self.activeBarButtonTitle];
}
}

}
}

@end
20 changes: 20 additions & 0 deletions APDropDownNavToolbar/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013 Ankur Patel

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.
19 changes: 19 additions & 0 deletions APDropDownNavToolbar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
APDropDownNavToolbar
====================

iOS7 Messages App style toolbar that drops down from navigation bar when tapping on the UIBarButton item

<table>
<tr>
<th>iOS 7 Messages App</th>
<th>APDropDownNavToolbar Demo:</th>
</tr>
<tr>
<td valign="top">
<img width=320 src="http://i.i.cbsi.com/cnwk.1d/i/tim2/2013/09/20/iOS_7_info_button.jpg"/>
</td>
<td>
<img width=320 src="http://recordit.co/TTQEYkYMtA.gif"/>
</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// FFCircularProgressBar.h
// FFCircularProgressBar
//
// Created by Fabiano Francesconi on 16/07/13.
// Copyright (c) 2013 Fabiano Francesconi. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <CoreGraphics/CoreGraphics.h>

@interface FFCircularProgressView : UIView

/**
* The progress of the view.
**/
@property (nonatomic, assign) CGFloat progress;

/**
* The width of the line used to draw the progress view.
**/
@property (nonatomic, assign) CGFloat lineWidth;

/**
* The color of the progress view
*/
@property (nonatomic, strong) UIColor *tintColor;

/**
* The color of the tick view
*/
@property (nonatomic, strong) UIColor *tickColor;

/**
* Icon view to be rendered instead of default arrow
*/
@property (nonatomic, strong) UIView* iconView;

/**
* Bezier path to be rendered instead of icon view or default arrow
*/
@property (nonatomic, strong) UIBezierPath* iconPath;

/**
* You can hide the icons which are shown during progress
*/
@property (readwrite) BOOL hideProgressIcons;

/**
* Make the background layer to spin around its center. This should be called in the main thread.
*/
- (void) startSpinProgressBackgroundLayer;

/**
* Stop the spinning of the background layer. This should be called in the main thread.
* WARN: This implementation remove all animations from background layer.
**/
- (void) stopSpinProgressBackgroundLayer;

@end

0 comments on commit a5b5acb

Please sign in to comment.