From e105a37f5b1a37e005567f6f4f53b4e87be7b4bc Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Thu, 8 Oct 2015 13:39:06 -0700 Subject: [PATCH] Added Test [NEW]: Added a tableView to the demo in order to test different features --- .../project.pbxproj | 6 + .../Base.lproj/Main.storyboard | 262 ++++++++++++++++-- .../TLYMenuTableViewController.h | 13 + .../TLYMenuTableViewController.m | 44 +++ .../TLYShyNavBarDemo/TLYViewController.m | 6 +- 5 files changed, 311 insertions(+), 20 deletions(-) create mode 100644 TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.h create mode 100644 TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.m diff --git a/TLYShyNavBarDemo/TLYShyNavBarDemo.xcodeproj/project.pbxproj b/TLYShyNavBarDemo/TLYShyNavBarDemo.xcodeproj/project.pbxproj index 19b05af..d5fd9c9 100644 --- a/TLYShyNavBarDemo/TLYShyNavBarDemo.xcodeproj/project.pbxproj +++ b/TLYShyNavBarDemo/TLYShyNavBarDemo.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 828F57491949C37B009EB8DD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 828F57471949C37B009EB8DD /* InfoPlist.strings */; }; 828F574B1949C37B009EB8DD /* TLYShyNavBarDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 828F574A1949C37B009EB8DD /* TLYShyNavBarDemoTests.m */; }; 829FEE001957DF620017E186 /* NSObject+TLYSwizzlingHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 829FEDFF1957DF620017E186 /* NSObject+TLYSwizzlingHelpers.m */; }; + 82A893861BC6F939004C37E3 /* TLYMenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 82A893851BC6F939004C37E3 /* TLYMenuTableViewController.m */; settings = {ASSET_TAGS = (); }; }; 82B01ED3195D449F00C3C10C /* TLYDelegateProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 82B01ED2195D449F00C3C10C /* TLYDelegateProxy.m */; }; 82C882091955FDA60046C49D /* UIViewController+BetterLayoutGuides.m in Sources */ = {isa = PBXBuildFile; fileRef = 82C882081955FDA60046C49D /* UIViewController+BetterLayoutGuides.m */; }; /* End PBXBuildFile section */ @@ -64,6 +65,8 @@ 828F574A1949C37B009EB8DD /* TLYShyNavBarDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TLYShyNavBarDemoTests.m; sourceTree = ""; }; 829FEDFE1957DF620017E186 /* NSObject+TLYSwizzlingHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+TLYSwizzlingHelpers.h"; sourceTree = ""; }; 829FEDFF1957DF620017E186 /* NSObject+TLYSwizzlingHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+TLYSwizzlingHelpers.m"; sourceTree = ""; }; + 82A893841BC6F939004C37E3 /* TLYMenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLYMenuTableViewController.h; sourceTree = ""; }; + 82A893851BC6F939004C37E3 /* TLYMenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLYMenuTableViewController.m; sourceTree = ""; }; 82B01ED1195D449F00C3C10C /* TLYDelegateProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLYDelegateProxy.h; sourceTree = ""; }; 82B01ED2195D449F00C3C10C /* TLYDelegateProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLYDelegateProxy.m; sourceTree = ""; }; 82C882071955FDA60046C49D /* UIViewController+BetterLayoutGuides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+BetterLayoutGuides.h"; sourceTree = ""; }; @@ -131,6 +134,8 @@ 828F572E1949C37B009EB8DD /* TLYAppDelegate.h */, 828F572F1949C37B009EB8DD /* TLYAppDelegate.m */, 828F57311949C37B009EB8DD /* Main.storyboard */, + 82A893841BC6F939004C37E3 /* TLYMenuTableViewController.h */, + 82A893851BC6F939004C37E3 /* TLYMenuTableViewController.m */, 828F57341949C37B009EB8DD /* TLYViewController.h */, 828F57351949C37B009EB8DD /* TLYViewController.m */, 828F57371949C37B009EB8DD /* Images.xcassets */, @@ -292,6 +297,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 82A893861BC6F939004C37E3 /* TLYMenuTableViewController.m in Sources */, 8268FA13194DBA58004EC0E4 /* TLYShyNavBarManager.m in Sources */, 82C882091955FDA60046C49D /* UIViewController+BetterLayoutGuides.m in Sources */, 828F57301949C37B009EB8DD /* TLYAppDelegate.m in Sources */, diff --git a/TLYShyNavBarDemo/TLYShyNavBarDemo/Base.lproj/Main.storyboard b/TLYShyNavBarDemo/TLYShyNavBarDemo/Base.lproj/Main.storyboard index b8ee658..6b27d7d 100644 --- a/TLYShyNavBarDemo/TLYShyNavBarDemo/Base.lproj/Main.storyboard +++ b/TLYShyNavBarDemo/TLYShyNavBarDemo/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -16,17 +17,14 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + diff --git a/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.h b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.h new file mode 100644 index 0000000..61d9258 --- /dev/null +++ b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.h @@ -0,0 +1,13 @@ +// +// TLYMenuTableViewController.h +// TLYShyNavBarDemo +// +// Created by Mazyad Alabduljaleel on 10/8/15. +// Copyright © 2015 Telly, Inc. All rights reserved. +// + +#import + +@interface TLYMenuTableViewController : UITableViewController + +@end diff --git a/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.m b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.m new file mode 100644 index 0000000..398772c --- /dev/null +++ b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYMenuTableViewController.m @@ -0,0 +1,44 @@ +// +// TLYMenuTableViewController.m +// TLYShyNavBarDemo +// +// Created by Mazyad Alabduljaleel on 10/8/15. +// Copyright © 2015 Telly, Inc. All rights reserved. +// + +#import "TLYMenuTableViewController.h" + +@interface TLYMenuTableViewController () + +@end + +@implementation TLYMenuTableViewController + +#pragma mark - Init & Dealloc + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + self.title = @"Features"; + } + return self; +} + +#pragma mark - Table view data source + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 5; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSString *cellId = [@(indexPath.row) stringValue]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId + forIndexPath:indexPath]; + + return cell; +} + +@end diff --git a/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYViewController.m b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYViewController.m index d1fb30d..b5a71ea 100644 --- a/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYViewController.m +++ b/TLYShyNavBarDemo/TLYShyNavBarDemo/TLYViewController.m @@ -10,6 +10,10 @@ @interface TLYViewController () +/* we set this in the xib as a runtime property */ +@property (nonatomic, assign) IBInspectable BOOL stickyExtensionView; +@property (nonatomic, assign) IBInspectable NSInteger fadeBehavior; + @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @property (weak, nonatomic) IBOutlet UIImageView *imageView; @@ -38,7 +42,7 @@ /* Can then be remove by setting the ExtensionView to nil */ [self.shyNavBarManager setExtensionView:view]; /* Make the extension view stick to the top */ - [self.shyNavBarManager setStickyExtensionView:YES]; + [self.shyNavBarManager setStickyExtensionView:self.stickyExtensionView]; } - (void)viewDidLayoutSubviews