Compare commits
No commits in common. "master" and "1.0.1" have entirely different histories.
|
|
@ -3,7 +3,7 @@
|
|||
__v1.0, Finally! With better code design, and fully featured!__
|
||||
-----
|
||||
|
||||

|
||||

|
||||

|
||||
[](https://github.com/Carthage/Carthage)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
|
||||
@interface UIScrollView (Helpers)
|
||||
|
||||
- (void)tly_setInsets:(UIEdgeInsets)contentInsets;
|
||||
- (void)tly_setInsets:(UIEdgeInsets)contentInsets preserveOffset:(BOOL)preserveOffset;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@
|
|||
@implementation UIScrollView (Helpers)
|
||||
|
||||
// Modify contentInset and scrollIndicatorInsets
|
||||
- (void)tly_setInsets:(UIEdgeInsets)contentInsets
|
||||
- (void)tly_setInsets:(UIEdgeInsets)contentInsets preserveOffset:(BOOL)preserveOffset
|
||||
{
|
||||
if (!self.isDragging && !self.isDecelerating && contentInsets.top != self.contentInset.top)
|
||||
if (preserveOffset && contentInsets.top != self.contentInset.top)
|
||||
{
|
||||
CGFloat offsetDelta = contentInsets.top - self.contentInset.top;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@
|
|||
@interface TLYShyScrollViewController : NSObject <TLYShyChild>
|
||||
|
||||
@property (nonatomic, weak) UIScrollView *scrollView;
|
||||
@property (nonatomic, weak) UIRefreshControl *refreshControl;
|
||||
@property (nonatomic, weak) TLYShyViewController *parent;
|
||||
|
||||
- (CGFloat)updateLayoutIfNeeded;
|
||||
- (CGFloat)updateLayoutIfNeeded:(BOOL)intelligently;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
|
||||
- (void)offsetCenterBy:(CGPoint)deltaPoint
|
||||
{
|
||||
[self updateLayoutIfNeeded];
|
||||
[self updateLayoutIfNeeded:NO];
|
||||
}
|
||||
|
||||
- (CGFloat)updateLayoutIfNeeded
|
||||
- (CGFloat)updateLayoutIfNeeded:(BOOL)intelligently
|
||||
{
|
||||
if (self.scrollView.contentSize.height < FLT_EPSILON
|
||||
&& ([self.scrollView isKindOfClass:[UITableView class]]
|
||||
|
|
@ -26,32 +26,29 @@
|
|||
{
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
|
||||
CGFloat parentMaxY = [self.parent maxYRelativeToView:self.scrollView.superview];
|
||||
CGFloat normalizedY = parentMaxY - self.scrollView.frame.origin.y;
|
||||
UIEdgeInsets insets = UIEdgeInsetsMake(self.scrollView.contentInset.top, 0, self.scrollView.contentInset.bottom, 0);
|
||||
UIEdgeInsets insets = self.scrollView.contentInset;
|
||||
insets.top = normalizedY;
|
||||
|
||||
|
||||
if (normalizedY > -FLT_EPSILON && !UIEdgeInsetsEqualToEdgeInsets(insets, self.scrollView.contentInset))
|
||||
{
|
||||
CGFloat delta = insets.top - self.scrollView.contentInset.top;
|
||||
|
||||
if (self.refreshControl == nil || [self.refreshControl isHidden]) {
|
||||
[self.scrollView tly_setInsets:insets];
|
||||
}
|
||||
|
||||
[self.scrollView tly_setInsets:insets preserveOffset:intelligently];
|
||||
|
||||
return delta;
|
||||
}
|
||||
|
||||
|
||||
if (normalizedY < -FLT_EPSILON)
|
||||
{
|
||||
{
|
||||
CGRect frame = self.scrollView.frame;
|
||||
frame = UIEdgeInsetsInsetRect(frame, insets);
|
||||
|
||||
|
||||
self.scrollView.frame = frame;
|
||||
return [self updateLayoutIfNeeded];
|
||||
return [self updateLayoutIfNeeded:YES];
|
||||
}
|
||||
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,21 +37,16 @@ typedef CGFloat(^TLYShyViewControllerContractionAmountBlock)(UIView *view);
|
|||
@property (nonatomic, weak) TLYShyViewController *subShyController;
|
||||
@property (nonatomic, weak) UIView *view;
|
||||
|
||||
@property (nonatomic, assign, readonly) BOOL contracted;
|
||||
@property (nonatomic, assign, readonly) BOOL expanded;
|
||||
|
||||
@property (nonatomic) TLYShyNavBarFade fadeBehavior;
|
||||
|
||||
/* Sticky means it will always stay in expanded state
|
||||
*/
|
||||
@property (nonatomic) BOOL sticky;
|
||||
@property (nonatomic) BOOL handleStatusBar;
|
||||
|
||||
- (void)offsetCenterBy:(CGPoint)deltaPoint;
|
||||
- (CGFloat)updateYOffset:(CGFloat)deltaY;
|
||||
|
||||
- (CGFloat)snap:(BOOL)contract;
|
||||
- (CGFloat)snap:(BOOL)contract completion:(void (^)())completion;
|
||||
|
||||
- (CGFloat)expand;
|
||||
- (CGFloat)contract;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "TLYShyViewController.h"
|
||||
|
||||
|
||||
@implementation TLYShyViewController (AsParent)
|
||||
|
||||
- (CGFloat)maxYRelativeToView:(UIView *)superview
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
|
||||
@end
|
||||
|
||||
static CGFloat const kTLYShyViewControllerStatusBarHeight = 20.0f;
|
||||
|
||||
@interface TLYShyViewController ()
|
||||
|
||||
|
|
@ -56,11 +56,7 @@ static CGFloat const kTLYShyViewControllerStatusBarHeight = 20.0f;
|
|||
|
||||
- (CGFloat)contractionAmountValue
|
||||
{
|
||||
CGFloat height = CGRectGetHeight(self.view.bounds);
|
||||
if (self.handleStatusBar && [UIApplication sharedApplication].isStatusBarHidden) {
|
||||
height -= kTLYShyViewControllerStatusBarHeight;
|
||||
}
|
||||
return self.sticky ? 0.f : height;
|
||||
return self.sticky ? 0.f : CGRectGetHeight(self.view.bounds);
|
||||
}
|
||||
|
||||
- (CGPoint)contractedCenterValue
|
||||
|
|
@ -192,11 +188,6 @@ static CGFloat const kTLYShyViewControllerStatusBarHeight = 20.0f;
|
|||
}
|
||||
|
||||
- (CGFloat)snap:(BOOL)contract
|
||||
{
|
||||
return [self snap:contract completion:nil];
|
||||
}
|
||||
|
||||
- (CGFloat)snap:(BOOL)contract completion:(void (^)())completion
|
||||
{
|
||||
/* "The Facebook" UX dictates that:
|
||||
*
|
||||
|
|
@ -220,12 +211,6 @@ static CGFloat const kTLYShyViewControllerStatusBarHeight = 20.0f;
|
|||
{
|
||||
deltaY = [self.subShyController expand];
|
||||
}
|
||||
}
|
||||
completion:^(BOOL finished)
|
||||
{
|
||||
if (completion && finished) {
|
||||
completion();
|
||||
}
|
||||
}];
|
||||
|
||||
return deltaY;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import "TLYShyNavBarFade.h"
|
||||
|
||||
@protocol TLYShyNavBarManagerDelegate;
|
||||
|
||||
/** CLASS DESCRIPTION:
|
||||
* ==================
|
||||
|
|
@ -55,7 +54,7 @@
|
|||
*/
|
||||
@property (nonatomic) BOOL stickyExtensionView;
|
||||
|
||||
/* Control the resistance when scrolling up/down before the navbar
|
||||
/* Control the resistance when scrolling up/down before the navbar
|
||||
* expands/contracts again.
|
||||
*/
|
||||
@property (nonatomic) CGFloat expansionResistance; // default 200
|
||||
|
|
@ -71,31 +70,6 @@
|
|||
*/
|
||||
@property (nonatomic) BOOL disable;
|
||||
|
||||
/* Use this to be notified about contraction and expansion events.
|
||||
*/
|
||||
@property (nonatomic, weak) id<TLYShyNavBarManagerDelegate> delegate;
|
||||
|
||||
@property (nonatomic) BOOL handleStatusBar;
|
||||
@property (nonatomic) BOOL contracted;
|
||||
@property (nonatomic) BOOL expanded;
|
||||
|
||||
- (void)expandWithCompletion:(void (^)())completion;
|
||||
|
||||
@end
|
||||
|
||||
/* PROTOCOL DESCRIPTION:
|
||||
* =====================
|
||||
* This protocol is used to notify an optional TLYShyNavBarManager's delegate
|
||||
* when a contraction or expansion finishes animating.
|
||||
*/
|
||||
@protocol TLYShyNavBarManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
- (void)shyNavBarManagerDidBecomeFullyContracted:(TLYShyNavBarManager *) shyNavBarManager;
|
||||
- (void)shyNavBarManagerDidFinishContracting:(TLYShyNavBarManager *) shyNavBarManager;
|
||||
- (void)shyNavBarManagerDidFinishExpanding:(TLYShyNavBarManager *) shyNavBarManager;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
@ -115,15 +89,5 @@
|
|||
/* Initially, this is nil, but created for you when you access it */
|
||||
@property (nonatomic, strong) TLYShyNavBarManager *shyNavBarManager;
|
||||
|
||||
/*
|
||||
* Set the TLYShyNavBarManager while also specifying a view controller
|
||||
*/
|
||||
- (void)setShyNavBarManager:(TLYShyNavBarManager *)shyNavBarManager
|
||||
viewController:(UIViewController *)viewController;
|
||||
|
||||
/* Use this to find out if a TLYShyNavBarManager instance was associated
|
||||
* to this view controller, without triggering its creation and association.
|
||||
*/
|
||||
- (BOOL)isShyNavBarManagerPresent;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -56,17 +56,17 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
if (self)
|
||||
{
|
||||
self.delegateProxy = [[TLYDelegateProxy alloc] initWithMiddleMan:self];
|
||||
|
||||
|
||||
/* Initialize defaults */
|
||||
self.contracting = NO;
|
||||
self.previousContractionState = YES;
|
||||
|
||||
|
||||
self.expansionResistance = 200.f;
|
||||
self.contractionResistance = 0.f;
|
||||
|
||||
|
||||
self.fadeBehavior = TLYShyNavBarFadeSubviews;
|
||||
self.previousYOffset = NAN;
|
||||
|
||||
|
||||
/* Initialize shy controllers */
|
||||
self.statusBarController = [[TLYShyStatusBarController alloc] init];
|
||||
self.scrollViewController = [[TLYShyScrollViewController alloc] init];
|
||||
|
|
@ -75,10 +75,10 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
self.extensionViewContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100.f, 0.f)];
|
||||
self.extensionViewContainer.backgroundColor = [UIColor clearColor];
|
||||
self.extensionViewContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin;
|
||||
|
||||
|
||||
self.extensionController = [[TLYShyViewController alloc] init];
|
||||
self.extensionController.view = self.extensionViewContainer;
|
||||
|
||||
|
||||
/* hierarchy setup */
|
||||
/* StatusBar <-- navbar <-->> extension <--> scrollView
|
||||
*/
|
||||
|
|
@ -88,7 +88,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
self.extensionController.parent = self.navBarController;
|
||||
self.extensionController.child = self.scrollViewController;
|
||||
self.scrollViewController.parent = self.extensionController;
|
||||
|
||||
|
||||
/* Notification helpers */
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationDidBecomeActive:)
|
||||
|
|
@ -110,7 +110,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
_scrollView.delegate = _delegateProxy.originalDelegate;
|
||||
}
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[_scrollView removeObserver:self forKeyPath:@"contentSize" context:kTLYShyNavBarManagerKVOContext];
|
||||
}
|
||||
|
|
@ -120,55 +120,47 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
- (void)setViewController:(UIViewController *)viewController
|
||||
{
|
||||
_viewController = viewController;
|
||||
|
||||
|
||||
if ([viewController isKindOfClass:[UITableViewController class]]
|
||||
|| [viewController.view isKindOfClass:[UITableViewController class]])
|
||||
{
|
||||
NSLog(@"*** WARNING: Please consider using a UIViewController with a UITableView as a subview ***");
|
||||
}
|
||||
|
||||
|
||||
UIView *navbar = viewController.navigationController.navigationBar;
|
||||
NSAssert(navbar != nil, @"Please make sure the viewController is already attached to a navigation controller.");
|
||||
|
||||
|
||||
viewController.extendedLayoutIncludesOpaqueBars = YES;
|
||||
|
||||
[self.extensionViewContainer removeFromSuperview];
|
||||
[self.viewController.view addSubview:self.extensionViewContainer];
|
||||
|
||||
|
||||
self.navBarController.view = navbar;
|
||||
|
||||
|
||||
[self layoutViews];
|
||||
}
|
||||
|
||||
- (void)setScrollView:(UIScrollView *)scrollView
|
||||
{
|
||||
[_scrollView removeObserver:self forKeyPath:@"contentSize" context:kTLYShyNavBarManagerKVOContext];
|
||||
|
||||
|
||||
if (_scrollView.delegate == self.delegateProxy)
|
||||
{
|
||||
_scrollView.delegate = self.delegateProxy.originalDelegate;
|
||||
}
|
||||
|
||||
|
||||
_scrollView = scrollView;
|
||||
self.scrollViewController.scrollView = scrollView;
|
||||
|
||||
NSUInteger index = [scrollView.subviews indexOfObjectPassingTest:^BOOL (id obj, NSUInteger idx, BOOL *stop) {
|
||||
return [obj isKindOfClass:[UIRefreshControl class]];
|
||||
}];
|
||||
|
||||
if (index != NSNotFound) {
|
||||
self.scrollViewController.refreshControl = [scrollView.subviews objectAtIndex:index];
|
||||
}
|
||||
|
||||
|
||||
if (_scrollView.delegate != self.delegateProxy)
|
||||
{
|
||||
self.delegateProxy.originalDelegate = _scrollView.delegate;
|
||||
_scrollView.delegate = (id)self.delegateProxy;
|
||||
}
|
||||
|
||||
|
||||
[self cleanup];
|
||||
[self layoutViews];
|
||||
|
||||
|
||||
[_scrollView addObserver:self forKeyPath:@"contentSize" options:0 context:kTLYShyNavBarManagerKVOContext];
|
||||
}
|
||||
|
||||
|
|
@ -216,25 +208,6 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
self.extensionController.sticky = stickyExtensionView;
|
||||
}
|
||||
|
||||
- (BOOL)handleStatusBar
|
||||
{
|
||||
return self.navBarController.handleStatusBar;
|
||||
}
|
||||
|
||||
- (void)setHandleStatusBar:(BOOL)handleStatusBar
|
||||
{
|
||||
self.navBarController.handleStatusBar = handleStatusBar;
|
||||
}
|
||||
|
||||
- (BOOL)contracted
|
||||
{
|
||||
return self.navBarController.contracted;
|
||||
}
|
||||
|
||||
- (BOOL)expanded
|
||||
{
|
||||
return self.navBarController.expanded;
|
||||
}
|
||||
|
||||
#pragma mark - Private methods
|
||||
|
||||
|
|
@ -251,7 +224,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
return (self.isViewControllerVisible && [self _scrollViewIsSuffecientlyLong]);
|
||||
}
|
||||
|
||||
|
|
@ -261,7 +234,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!isnan(self.previousYOffset))
|
||||
{
|
||||
// 1 - Calculate the delta
|
||||
|
|
@ -273,20 +246,20 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
deltaY = MIN(0, deltaY - (self.previousYOffset - start));
|
||||
}
|
||||
|
||||
|
||||
/* rounding to resolve a dumb issue with the contentOffset value */
|
||||
CGFloat end = floorf(self.scrollView.contentSize.height - CGRectGetHeight(self.scrollView.bounds) + self.scrollView.contentInset.bottom - 0.5f);
|
||||
if (self.previousYOffset > end && deltaY > 0)
|
||||
{
|
||||
deltaY = MAX(0, deltaY - self.previousYOffset + end);
|
||||
}
|
||||
|
||||
|
||||
// 3 - Update contracting variable
|
||||
if (fabs(deltaY) > FLT_EPSILON)
|
||||
{
|
||||
self.contracting = deltaY < 0;
|
||||
}
|
||||
|
||||
|
||||
// 4 - Check if contracting state changed, and do stuff if so
|
||||
if (self.contracting != self.previousContractionState)
|
||||
{
|
||||
|
|
@ -296,7 +269,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
|
||||
// GTH: Calculate the exact point to avoid expansion resistance
|
||||
// CGFloat statusBarHeight = [self.statusBarController calculateTotalHeightRecursively];
|
||||
|
||||
|
||||
// 5 - Apply resistance
|
||||
// 5.1 - Always apply resistance when contracting
|
||||
if (self.contracting)
|
||||
|
|
@ -311,31 +284,17 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
CGFloat availableResistance = self.expansionResistance - self.resistanceConsumed;
|
||||
self.resistanceConsumed = MIN(self.expansionResistance, self.resistanceConsumed + deltaY);
|
||||
|
||||
|
||||
deltaY = MAX(0, deltaY - availableResistance);
|
||||
}
|
||||
|
||||
|
||||
// 6 - Update the navigation bar shyViewController
|
||||
self.navBarController.fadeBehavior = self.fadeBehavior;
|
||||
|
||||
// 7 - Inform the delegate if needed
|
||||
CGFloat maxNavY = CGRectGetMaxY(self.navBarController.view.frame);
|
||||
CGFloat maxExtensionY = CGRectGetMaxY(self.extensionViewContainer.frame);
|
||||
CGFloat visibleTop;
|
||||
if (self.extensionViewContainer.hidden) {
|
||||
visibleTop = maxNavY;
|
||||
} else {
|
||||
visibleTop = MAX(maxNavY, maxExtensionY);
|
||||
}
|
||||
if (visibleTop == self.statusBarController.calculateTotalHeightRecursively) {
|
||||
if ([self.delegate respondsToSelector:@selector(shyNavBarManagerDidBecomeFullyContracted:)]) {
|
||||
[self.delegate shyNavBarManagerDidBecomeFullyContracted:self];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[self.navBarController updateYOffset:deltaY];
|
||||
}
|
||||
|
||||
|
||||
self.previousYOffset = self.scrollView.contentOffset.y;
|
||||
}
|
||||
|
||||
|
|
@ -345,26 +304,9 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
__weak __typeof(self) weakSelf;
|
||||
void (^completion)() = ^
|
||||
{
|
||||
__typeof(self) strongSelf = self;
|
||||
if (strongSelf) {
|
||||
if (strongSelf.contracting) {
|
||||
if ([strongSelf.delegate respondsToSelector:@selector(shyNavBarManagerDidFinishContracting:)]) {
|
||||
[strongSelf.delegate shyNavBarManagerDidFinishContracting:strongSelf];
|
||||
}
|
||||
} else {
|
||||
if ([strongSelf.delegate respondsToSelector:@selector(shyNavBarManagerDidFinishExpanding:)]) {
|
||||
[strongSelf.delegate shyNavBarManagerDidFinishExpanding:strongSelf];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
self.resistanceConsumed = 0;
|
||||
[self.navBarController snap:self.contracting completion:completion];
|
||||
[self.navBarController snap:self.contracting];
|
||||
}
|
||||
|
||||
#pragma mark - KVO
|
||||
|
|
@ -395,12 +337,12 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
{
|
||||
[_extensionView removeFromSuperview];
|
||||
_extensionView = view;
|
||||
|
||||
|
||||
CGRect bounds = view.frame;
|
||||
bounds.origin = CGPointZero;
|
||||
|
||||
|
||||
view.frame = bounds;
|
||||
|
||||
|
||||
self.extensionViewContainer.frame = bounds;
|
||||
[self.extensionViewContainer addSubview:view];
|
||||
self.extensionViewContainer.userInteractionEnabled = view.userInteractionEnabled;
|
||||
|
|
@ -421,7 +363,7 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
|
||||
- (void)layoutViews
|
||||
{
|
||||
if (fabs([self.scrollViewController updateLayoutIfNeeded]) > FLT_EPSILON)
|
||||
if (fabs([self.scrollViewController updateLayoutIfNeeded:YES]) > FLT_EPSILON)
|
||||
{
|
||||
[self.navBarController expand];
|
||||
[self.extensionViewContainer.superview bringSubviewToFront:self.extensionViewContainer];
|
||||
|
|
@ -434,17 +376,6 @@ static void * const kTLYShyNavBarManagerKVOContext = (void*)&kTLYShyNavBarManage
|
|||
self.previousYOffset = NAN;
|
||||
}
|
||||
|
||||
- (void)expandWithCompletion:(void (^)())completion
|
||||
{
|
||||
[UIView animateWithDuration:0.2 animations:^ {
|
||||
[self cleanup];
|
||||
} completion:^(BOOL finished) {
|
||||
if (completion) {
|
||||
completion();
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate methods
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
|
|
@ -523,26 +454,12 @@ static char shyNavBarManagerKey;
|
|||
[self tly_swizzledViewWillDisappear:animated];
|
||||
}
|
||||
|
||||
#pragma mark - Public methods
|
||||
|
||||
- (BOOL)isShyNavBarManagerPresent
|
||||
{
|
||||
return [self _internalShyNavBarManager] != nil;
|
||||
}
|
||||
|
||||
- (void)setShyNavBarManager:(TLYShyNavBarManager *)shyNavBarManager
|
||||
viewController:(UIViewController *)viewController
|
||||
{
|
||||
NSAssert(viewController != nil, @"viewController must not be nil!");
|
||||
shyNavBarManager.viewController = viewController;
|
||||
objc_setAssociatedObject(self, ­NavBarManagerKey, shyNavBarManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (void)setShyNavBarManager:(TLYShyNavBarManager *)shyNavBarManager
|
||||
{
|
||||
[self setShyNavBarManager:shyNavBarManager viewController:self];
|
||||
shyNavBarManager.viewController = self;
|
||||
objc_setAssociatedObject(self, ­NavBarManagerKey, shyNavBarManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
- (TLYShyNavBarManager *)shyNavBarManager
|
||||
|
|
@ -553,7 +470,7 @@ static char shyNavBarManagerKey;
|
|||
shyNavBarManager = [[TLYShyNavBarManager alloc] init];
|
||||
self.shyNavBarManager = shyNavBarManager;
|
||||
}
|
||||
|
||||
|
||||
return shyNavBarManager;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="7bU-2Z-BIA">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="7bU-2Z-BIA">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -144,7 +144,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -224,7 +224,7 @@
|
|||
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -353,7 +353,7 @@
|
|||
<label opaque="NO" userInteractionEnabled="NO" tag="777" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Vf-lE-VWT">
|
||||
<rect key="frame" x="8" y="14" width="42" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
|
|
@ -388,8 +388,8 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="zXM-Us-jtQ">
|
||||
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="zXM-Us-jtQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" id="NX5-B0-7pf">
|
||||
|
|
@ -408,12 +408,6 @@
|
|||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="zXM-Us-jtQ" firstAttribute="leading" secondItem="MSO-HM-o3C" secondAttribute="leading" id="YGz-6i-F6M"/>
|
||||
<constraint firstAttribute="right" secondItem="zXM-Us-jtQ" secondAttribute="right" id="g44-Ka-P9F"/>
|
||||
<constraint firstItem="sgb-uZ-rF7" firstAttribute="top" secondItem="zXM-Us-jtQ" secondAttribute="bottom" id="hhN-uq-WOi"/>
|
||||
<constraint firstItem="zXM-Us-jtQ" firstAttribute="top" secondItem="XjM-9z-Uam" secondAttribute="bottom" id="t3N-xs-ko0"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="l8b-W3-Ehj"/>
|
||||
<connections>
|
||||
|
|
@ -626,15 +620,15 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Nlh-YW-jQ7">
|
||||
<rect key="frame" x="0.0" y="64" width="335" height="504"/>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Nlh-YW-jQ7">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" id="jHM-wp-EHl">
|
||||
<rect key="frame" x="0.0" y="92" width="335" height="44"/>
|
||||
<rect key="frame" x="0.0" y="92" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jHM-wp-EHl" id="mGW-Ao-Srl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="335" height="43.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
|
|
@ -646,12 +640,6 @@
|
|||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Nlh-YW-jQ7" firstAttribute="left" secondItem="Trg-X5-aIb" secondAttribute="left" id="1rE-jk-8qx"/>
|
||||
<constraint firstItem="PvV-4v-hBz" firstAttribute="top" secondItem="Nlh-YW-jQ7" secondAttribute="bottom" id="H5W-2J-f2D"/>
|
||||
<constraint firstAttribute="right" secondItem="Nlh-YW-jQ7" secondAttribute="rightMargin" id="K6c-aA-di4"/>
|
||||
<constraint firstItem="Nlh-YW-jQ7" firstAttribute="top" secondItem="2aT-xe-cs2" secondAttribute="bottom" id="oJF-s6-iWb"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="uJw-Uj-Sb1"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
|
|
|
|||
Loading…
Reference in New Issue