diff --git a/AXStretchableHeaderTabViewController.podspec b/AXStretchableHeaderTabViewController.podspec index 74b5b1c..c3ed739 100644 --- a/AXStretchableHeaderTabViewController.podspec +++ b/AXStretchableHeaderTabViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "AXStretchableHeaderTabViewController" - s.version = "0.1.7" + s.version = "0.1.8" s.summary = "Stretchable header view + Horizontal swipable tab view." s.description = <<-DESC Stretchable header view + Horizontal swipable tab view diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b1a046..2a1f1b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # AXStretchableHeaderTabViewController CHANGELOG +## 0.1.8 + +Feature: No swipable header is default. Look at "No horizontal swipe header" example. + ## 0.1.7 Feature: Support "self" in interactive header view. diff --git a/Classes/AXStretchableHeaderView.m b/Classes/AXStretchableHeaderView.m index ca7442c..c59040c 100644 --- a/Classes/AXStretchableHeaderView.m +++ b/Classes/AXStretchableHeaderView.m @@ -43,11 +43,15 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event UIView *targetView = [super hitTest:point withEvent:event]; if (!targetView) { return nil; - } else if (targetView == self) { - return nil; } - NSArray *interactiveSubviews = [self.delegate interactiveSubviewsInStretchableHeaderView:self]; + NSArray *interactiveSubviews; + if ([self.delegate respondsToSelector:@selector(interactiveSubviewsInStretchableHeaderView:)]) { + interactiveSubviews = [self.delegate interactiveSubviewsInStretchableHeaderView:self]; + } else { + return targetView; + } + if ([interactiveSubviews containsObject:self]) { return targetView; } diff --git a/Example/StretchableHeaderTabViewExample.xcodeproj/project.pbxproj b/Example/StretchableHeaderTabViewExample.xcodeproj/project.pbxproj index 023e627..caf8432 100644 --- a/Example/StretchableHeaderTabViewExample.xcodeproj/project.pbxproj +++ b/Example/StretchableHeaderTabViewExample.xcodeproj/project.pbxproj @@ -29,8 +29,11 @@ 754814FA19323CC800CFD342 /* AXSampleTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 754814F819323CC800CFD342 /* AXSampleTabViewController.m */; }; 75481502193241A800CFD342 /* sample-photo.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 75481501193241A800CFD342 /* sample-photo.jpg */; }; 757BA7B219338CC3006ADDAF /* AXSampleNavBarTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 757BA7B119338CC3006ADDAF /* AXSampleNavBarTabViewController.m */; }; - 759D088E1935BEEB00E930BD /* AXSampleHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 759D088D1935BEEB00E930BD /* AXSampleHeaderView.m */; }; - 75A68DEB1935CBFD00C753FF /* AXSampleHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75A68DEA1935CBFD00C753FF /* AXSampleHeaderView.xib */; }; + 7584B665194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7584B664194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.m */; }; + 7584B667194A86ED00AEE4DF /* AXSampleNoSwipableHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7584B666194A86ED00AEE4DF /* AXSampleNoSwipableHeaderView.xib */; }; + 7584B66A194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7584B669194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.m */; }; + 759D088E1935BEEB00E930BD /* AXSampleSwipableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 759D088D1935BEEB00E930BD /* AXSampleSwipableHeaderView.m */; }; + 75A68DEB1935CBFD00C753FF /* AXSampleSwipableHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75A68DEA1935CBFD00C753FF /* AXSampleSwipableHeaderView.xib */; }; 7777FECBD35D45B6935E3121 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 77E2F7A94B9542CEA1F1CC2F /* libPods.a */; }; /* End PBXBuildFile section */ @@ -80,9 +83,14 @@ 75481501193241A800CFD342 /* sample-photo.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "sample-photo.jpg"; sourceTree = ""; }; 757BA7B019338CC3006ADDAF /* AXSampleNavBarTabViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSampleNavBarTabViewController.h; sourceTree = ""; }; 757BA7B119338CC3006ADDAF /* AXSampleNavBarTabViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSampleNavBarTabViewController.m; sourceTree = ""; }; - 759D088C1935BEEB00E930BD /* AXSampleHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSampleHeaderView.h; sourceTree = ""; }; - 759D088D1935BEEB00E930BD /* AXSampleHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSampleHeaderView.m; sourceTree = ""; }; - 75A68DEA1935CBFD00C753FF /* AXSampleHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AXSampleHeaderView.xib; sourceTree = ""; }; + 7584B663194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSampleNoSwipableHeaderView.h; sourceTree = ""; }; + 7584B664194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSampleNoSwipableHeaderView.m; sourceTree = ""; }; + 7584B666194A86ED00AEE4DF /* AXSampleNoSwipableHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AXSampleNoSwipableHeaderView.xib; sourceTree = ""; }; + 7584B668194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSampleNoSwipableTabViewController.h; sourceTree = ""; }; + 7584B669194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSampleNoSwipableTabViewController.m; sourceTree = ""; }; + 759D088C1935BEEB00E930BD /* AXSampleSwipableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AXSampleSwipableHeaderView.h; sourceTree = ""; }; + 759D088D1935BEEB00E930BD /* AXSampleSwipableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AXSampleSwipableHeaderView.m; sourceTree = ""; }; + 75A68DEA1935CBFD00C753FF /* AXSampleSwipableHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AXSampleSwipableHeaderView.xib; sourceTree = ""; }; 77E2F7A94B9542CEA1F1CC2F /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; CDE287AB09714778AADFE7FE /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -160,9 +168,8 @@ 75101E7519370B3E00AE76E8 /* Header View */ = { isa = PBXGroup; children = ( - 759D088C1935BEEB00E930BD /* AXSampleHeaderView.h */, - 759D088D1935BEEB00E930BD /* AXSampleHeaderView.m */, - 75A68DEA1935CBFD00C753FF /* AXSampleHeaderView.xib */, + 7584B661194A85D800AEE4DF /* Swipable header view */, + 7584B660194A85C800AEE4DF /* No swipe header view */, ); name = "Header View"; sourceTree = ""; @@ -272,12 +279,42 @@ 754814DD19323A9400CFD342 /* Sub View Controllers */, 75101E7319370B0400AE76E8 /* TabVC (no bounce) */, 75101E7419370B1000AE76E8 /* TabVC (no header) */, + 7584B662194A869D00AEE4DF /* TabVC (no swipe) */, 75101E7119370ADC00AE76E8 /* TabVC (with Nav Bar) */, 75101E7219370AF000AE76E8 /* TabVC (without Nav Bar) */, ); name = "Sample Tab View Controller"; sourceTree = ""; }; + 7584B660194A85C800AEE4DF /* No swipe header view */ = { + isa = PBXGroup; + children = ( + 7584B663194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.h */, + 7584B664194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.m */, + 7584B666194A86ED00AEE4DF /* AXSampleNoSwipableHeaderView.xib */, + ); + name = "No swipe header view"; + sourceTree = ""; + }; + 7584B661194A85D800AEE4DF /* Swipable header view */ = { + isa = PBXGroup; + children = ( + 759D088C1935BEEB00E930BD /* AXSampleSwipableHeaderView.h */, + 759D088D1935BEEB00E930BD /* AXSampleSwipableHeaderView.m */, + 75A68DEA1935CBFD00C753FF /* AXSampleSwipableHeaderView.xib */, + ); + name = "Swipable header view"; + sourceTree = ""; + }; + 7584B662194A869D00AEE4DF /* TabVC (no swipe) */ = { + isa = PBXGroup; + children = ( + 7584B668194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.h */, + 7584B669194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.m */, + ); + name = "TabVC (no swipe)"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -356,9 +393,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7584B667194A86ED00AEE4DF /* AXSampleNoSwipableHeaderView.xib in Resources */, 75481502193241A800CFD342 /* sample-photo.jpg in Resources */, 754814A9193234F400CFD342 /* InfoPlist.strings in Resources */, - 75A68DEB1935CBFD00C753FF /* AXSampleHeaderView.xib in Resources */, + 75A68DEB1935CBFD00C753FF /* AXSampleSwipableHeaderView.xib in Resources */, 754814B1193234F400CFD342 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -414,13 +452,15 @@ 75101E141935F7C500AE76E8 /* AXSampleNoBounceTabViewController.m in Sources */, 754814AB193234F400CFD342 /* main.m in Sources */, 754814E319323ABF00CFD342 /* AXSub2TableViewController.m in Sources */, - 759D088E1935BEEB00E930BD /* AXSampleHeaderView.m in Sources */, + 759D088E1935BEEB00E930BD /* AXSampleSwipableHeaderView.m in Sources */, 754814FA19323CC800CFD342 /* AXSampleTabViewController.m in Sources */, 75101E6E19370AC100AE76E8 /* AXEmptyViewController.m in Sources */, 754814E019323AA400CFD342 /* AXSub1TableViewController.m in Sources */, 757BA7B219338CC3006ADDAF /* AXSampleNavBarTabViewController.m in Sources */, 754814AF193234F400CFD342 /* AXAppDelegate.m in Sources */, 754814E619323ADF00CFD342 /* AXSub3ViewController.m in Sources */, + 7584B665194A86C900AEE4DF /* AXSampleNoSwipableHeaderView.m in Sources */, + 7584B66A194A875F00AEE4DF /* AXSampleNoSwipableTabViewController.m in Sources */, 75101E5E1936CE0F00AE76E8 /* AXSampleNoHeaderTabViewController.m in Sources */, 754814DC1932394E00CFD342 /* AXSampleListViewController.m in Sources */, ); diff --git a/Example/StretchableHeaderTabViewExample/AXSampleListViewController.m b/Example/StretchableHeaderTabViewExample/AXSampleListViewController.m index b6fba24..8b89c34 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleListViewController.m +++ b/Example/StretchableHeaderTabViewExample/AXSampleListViewController.m @@ -8,12 +8,15 @@ #import "AXSampleNavBarTabViewController.h" #import "AXSampleNoBounceTabViewController.h" #import "AXSampleNoHeaderTabViewController.h" +#import "AXSampleNoSwipableTabViewController.h" @interface AXSampleListViewController () @end -@implementation AXSampleListViewController +@implementation AXSampleListViewController { + NSArray *_cellTitles; +} - (id)initWithStyle:(UITableViewStyle)style { @@ -29,6 +32,14 @@ - (void)viewDidLoad [super viewDidLoad]; [self setTitle:@"Stretchable header tab view"]; + _cellTitles = + @[@"Sample", + @"No NavigationBar", + @"No bounce", + @"No header", + @"No horizontal swipe header", + ]; + [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"list-cell"]; } @@ -47,19 +58,14 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 4; + return _cellTitles.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"list-cell" forIndexPath:indexPath]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; - [cell.textLabel setText: - @[@"Sample", - @"Sample with no NavigationBar", - @"Sample with no bounce", - @"Sample with no header view", - ][indexPath.row]]; + [cell.textLabel setText:_cellTitles[indexPath.row]]; return cell; } @@ -88,6 +94,11 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath [self.navigationController pushViewController:tabViewCon animated:YES]; break; } + case 4: { + AXSampleNoSwipableTabViewController *tabViewCon = [[AXSampleNoSwipableTabViewController alloc] init]; + [self.navigationController pushViewController:tabViewCon animated:YES]; + break; + } default: break; } diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNavBarTabViewController.m b/Example/StretchableHeaderTabViewExample/AXSampleNavBarTabViewController.m index 8afe45c..6f36197 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleNavBarTabViewController.m +++ b/Example/StretchableHeaderTabViewExample/AXSampleNavBarTabViewController.m @@ -7,7 +7,7 @@ #import "AXSub1TableViewController.h" #import "AXSub2TableViewController.h" #import "AXSub3ViewController.h" -#import "AXSampleHeaderView.h" +#import "AXSampleSwipableHeaderView.h" @interface AXSampleNavBarTabViewController () @@ -21,7 +21,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil if (self) { self.title = @"Sample"; - AXSampleHeaderView *headerView = [[AXSampleHeaderView alloc] init]; + AXSampleSwipableHeaderView *headerView = [[AXSampleSwipableHeaderView alloc] init]; self.headerView = headerView; AXSub1TableViewController *sub1ViewCon = [[AXSub1TableViewController alloc] init]; @@ -41,7 +41,7 @@ - (void)viewDidLoad self.headerView.minimumOfHeight = 64.0; self.headerView.maximumOfHeight = 220.0; - AXSampleHeaderView *headerView = (id)self.headerView; + AXSampleSwipableHeaderView *headerView = (id)self.headerView; headerView.textLabel.text = @"The Duomo in Firenze"; headerView.imageView.image = [UIImage imageNamed:@"sample-photo.jpg"]; [headerView.backButton setTitle:@"back" forState:UIControlStateNormal]; diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoBounceTabViewController.m b/Example/StretchableHeaderTabViewExample/AXSampleNoBounceTabViewController.m index 41cd4bb..a897033 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleNoBounceTabViewController.m +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoBounceTabViewController.m @@ -6,7 +6,7 @@ #import "AXSampleNoBounceTabViewController.h" #import "AXSub1TableViewController.h" #import "AXSub2TableViewController.h" -#import "AXSampleHeaderView.h" +#import "AXSampleSwipableHeaderView.h" @interface AXSampleNoBounceTabViewController () @@ -20,7 +20,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil if (self) { self.title = @"No Bounce"; - AXSampleHeaderView *headerView = [[AXSampleHeaderView alloc] init]; + AXSampleSwipableHeaderView *headerView = [[AXSampleSwipableHeaderView alloc] init]; // THIS IS THE POINT IN THIS FILE. headerView.bounces = NO; @@ -44,7 +44,7 @@ - (void)viewDidLoad self.headerView.minimumOfHeight = 64.0; self.headerView.maximumOfHeight = 220.0; - AXSampleHeaderView *headerView = (id)self.headerView; + AXSampleSwipableHeaderView *headerView = (id)self.headerView; headerView.textLabel.text = @"The Duomo in Firenze"; headerView.imageView.image = [UIImage imageNamed:@"sample-photo.jpg"]; [headerView.backButton setTitle:@"back" forState:UIControlStateNormal]; diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.h b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.h new file mode 100644 index 0000000..bd716cc --- /dev/null +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.h @@ -0,0 +1,10 @@ +// +// AXSampleNoSwipableHeaderView.h +// StretchableHeaderTabViewExample +// + +#import "AXStretchableHeaderView.h" + +@interface AXSampleNoSwipableHeaderView : AXStretchableHeaderView + +@end diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.m b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.m new file mode 100644 index 0000000..067b005 --- /dev/null +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.m @@ -0,0 +1,20 @@ +// +// AXSampleNoSwipableHeaderView.m +// StretchableHeaderTabViewExample +// + +#import "AXSampleNoSwipableHeaderView.h" + +@implementation AXSampleNoSwipableHeaderView + +- (id)initWithFrame:(CGRect)frame +{ + UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil]; + self = [[nib instantiateWithOwner:self options:nil] firstObject]; + if (self) { + // Nothing to do, if you want to make no swipable header. + } + return self; +} + +@end diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.xib b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.xib new file mode 100644 index 0000000..1515b4e --- /dev/null +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.xib @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.h b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.h new file mode 100644 index 0000000..573ffed --- /dev/null +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.h @@ -0,0 +1,10 @@ +// +// AXSampleNoSwipableTabViewController.h +// StretchableHeaderTabViewExample +// + +#import "AXStretchableHeaderTabViewController.h" + +@interface AXSampleNoSwipableTabViewController : AXStretchableHeaderTabViewController + +@end diff --git a/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.m b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.m new file mode 100644 index 0000000..f24de35 --- /dev/null +++ b/Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.m @@ -0,0 +1,44 @@ +// +// AXSampleNoSwipableTabViewController.m +// StretchableHeaderTabViewExample +// + +#import "AXSampleNoSwipableTabViewController.h" +#import "AXSub1TableViewController.h" +#import "AXSub2TableViewController.h" +#import "AXSampleNoSwipableHeaderView.h" + +@implementation AXSampleNoSwipableTabViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + self.title = @"No horizontal swipe header"; + + AXSampleNoSwipableHeaderView *headerView = [[AXSampleNoSwipableHeaderView alloc] init]; + self.headerView = headerView; + + AXSub1TableViewController *sub1ViewCon = [[AXSub1TableViewController alloc] init]; + AXSub2TableViewController *sub2ViewCon = [[AXSub2TableViewController alloc] init]; + + NSArray *viewControllers = @[sub1ViewCon, sub2ViewCon]; + self.viewControllers = viewControllers; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.headerView.minimumOfHeight = 64.0; + self.headerView.maximumOfHeight = 220.0; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; +} + +@end diff --git a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.h b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.h similarity index 74% rename from Example/StretchableHeaderTabViewExample/AXSampleHeaderView.h rename to Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.h index 23df1eb..4b39f95 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.h +++ b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.h @@ -5,7 +5,7 @@ #import "AXStretchableHeaderView.h" -@interface AXSampleHeaderView : AXStretchableHeaderView +@interface AXSampleSwipableHeaderView : AXStretchableHeaderView @property (weak, nonatomic) IBOutlet UILabel *textLabel; @property (weak, nonatomic) IBOutlet UIButton *backButton; @property (weak, nonatomic) IBOutlet UIImageView *imageView; diff --git a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.m b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.m similarity index 67% rename from Example/StretchableHeaderTabViewExample/AXSampleHeaderView.m rename to Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.m index 69a2839..61d5d31 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.m +++ b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.m @@ -3,9 +3,9 @@ // StretchableHeaderTabViewExample // -#import "AXSampleHeaderView.h" +#import "AXSampleSwipableHeaderView.h" -@implementation AXSampleHeaderView { +@implementation AXSampleSwipableHeaderView { NSArray *_interactiveSubviews; } @@ -20,15 +20,6 @@ - (id)initWithFrame:(CGRect)frame return self; } -/* - // Only override drawRect: if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - - (void)drawRect:(CGRect)rect - { - // Drawing code - } - */ - - (NSArray *)interactiveSubviewsInStretchableHeaderView:(AXStretchableHeaderView *)stretchableHeaderView { return _interactiveSubviews; diff --git a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.xib b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.xib similarity index 99% rename from Example/StretchableHeaderTabViewExample/AXSampleHeaderView.xib rename to Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.xib index 12c0691..4794ba6 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleHeaderView.xib +++ b/Example/StretchableHeaderTabViewExample/AXSampleSwipableHeaderView.xib @@ -6,7 +6,7 @@ - + diff --git a/Example/StretchableHeaderTabViewExample/AXSampleTabViewController.m b/Example/StretchableHeaderTabViewExample/AXSampleTabViewController.m index f271c4b..42f63f5 100644 --- a/Example/StretchableHeaderTabViewExample/AXSampleTabViewController.m +++ b/Example/StretchableHeaderTabViewExample/AXSampleTabViewController.m @@ -7,7 +7,7 @@ #import "AXSub1TableViewController.h" #import "AXSub2TableViewController.h" #import "AXSub3ViewController.h" -#import "AXSampleHeaderView.h" +#import "AXSampleSwipableHeaderView.h" @interface AXSampleTabViewController () @@ -19,7 +19,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { - AXSampleHeaderView *headerView = [[AXSampleHeaderView alloc] init]; + AXSampleSwipableHeaderView *headerView = [[AXSampleSwipableHeaderView alloc] init]; self.headerView = headerView; AXSub1TableViewController *sub1ViewCon = [[AXSub1TableViewController alloc] init]; @@ -39,7 +39,7 @@ - (void)viewDidLoad self.headerView.minimumOfHeight = 64.0; self.headerView.maximumOfHeight = 220.0; - AXSampleHeaderView *headerView = (id)self.headerView; + AXSampleSwipableHeaderView *headerView = (id)self.headerView; headerView.textLabel.text = @"The Duomo in Firenze"; headerView.imageView.image = [UIImage imageNamed:@"sample-photo.jpg"]; [headerView.backButton setTitle:@"back" forState:UIControlStateNormal];