forked from akiroom/AXStretchableHeaderTabViewController
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug and add no swipable header example. FIXED: akiroom#10
- Loading branch information
Hiroki Akiyama
committed
Jun 13, 2014
1 parent
c15ed76
commit a7f4680
Showing
16 changed files
with
214 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// AXSampleNoSwipableHeaderView.h | ||
// StretchableHeaderTabViewExample | ||
// | ||
|
||
#import "AXStretchableHeaderView.h" | ||
|
||
@interface AXSampleNoSwipableHeaderView : AXStretchableHeaderView | ||
|
||
@end |
20 changes: 20 additions & 0 deletions
20
Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
36 changes: 36 additions & 0 deletions
36
Example/StretchableHeaderTabViewExample/AXSampleNoSwipableHeaderView.xib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view contentMode="scaleToFill" id="bc0-DT-ocZ" customClass="AXSampleSwipableHeaderView"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="333"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sample-photo.jpg" translatesAutoresizingMaskIntoConstraints="NO" id="7eN-xe-VFm"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="333"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
</imageView> | ||
</subviews> | ||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="calibratedRGB"/> | ||
<constraints> | ||
<constraint firstItem="7eN-xe-VFm" firstAttribute="top" secondItem="bc0-DT-ocZ" secondAttribute="top" id="Wbn-bY-q1v"/> | ||
<constraint firstAttribute="trailing" secondItem="7eN-xe-VFm" secondAttribute="trailing" id="ci6-e5-saH"/> | ||
<constraint firstItem="7eN-xe-VFm" firstAttribute="leading" secondItem="bc0-DT-ocZ" secondAttribute="leading" id="oXJ-Wb-VQR"/> | ||
<constraint firstAttribute="bottom" secondItem="7eN-xe-VFm" secondAttribute="bottom" id="ort-eA-qbl"/> | ||
</constraints> | ||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<connections> | ||
<outlet property="imageView" destination="7eN-xe-VFm" id="u7L-to-xf8"/> | ||
<outlet property="topConstraint" destination="Wbn-bY-q1v" id="F6C-ot-c0O"/> | ||
</connections> | ||
</view> | ||
</objects> | ||
<resources> | ||
<image name="sample-photo.jpg" width="960" height="460"/> | ||
</resources> | ||
</document> |
10 changes: 10 additions & 0 deletions
10
Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// AXSampleNoSwipableTabViewController.h | ||
// StretchableHeaderTabViewExample | ||
// | ||
|
||
#import "AXStretchableHeaderTabViewController.h" | ||
|
||
@interface AXSampleNoSwipableTabViewController : AXStretchableHeaderTabViewController | ||
|
||
@end |
44 changes: 44 additions & 0 deletions
44
Example/StretchableHeaderTabViewExample/AXSampleNoSwipableTabViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.