Skip to content

Commit

Permalink
Merge branch 'pagingView' of github.com:xmartlabs/XLPagerTabStrip int…
Browse files Browse the repository at this point in the history
…o pagingView
  • Loading branch information
Martin Barreto committed Apr 9, 2015
2 parents ac0e4ed + 43f868c commit 43d9302
Show file tree
Hide file tree
Showing 24 changed files with 285 additions and 199 deletions.
Binary file modified .DS_Store
Binary file not shown.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ Integrate `XLPagerTabStrip` is as easy as following these steps:

2. The recently created concrete view controller should conform to `XLPagerTabStripViewControllerDataSource` implementing: `-(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController;`

3. (Recomended) Set up your view controllers using a nib file or a Storyboard. We need to connect some IBOutlets (take a look at the [Demo folder](XLPagerTabStrip/Demo)).
3. (Recomended) Set up your view controllers using a nib file or a Storyboard. We need to connect some IBOutlets (take a look at the [Demo folder](XLPagerTabStrip/Demo)).

4. Enjoy!

For further details take a look at the [Demo folder](XLPagerTabStrip/Demo) to see the code of examples shown above.

FAQ
----------------------

#####How to change the visible child view controller programmatically

`XLPagerTabStripViewController` provides the following methods to programmatically change the visible child view controller:

```objc
-(void)moveToViewControllerAtIndex:(NSUInteger)index;
-(void)moveToViewController:(UIViewController *)viewController;
```

Installation
--------------------------
Expand All @@ -46,7 +57,8 @@ Customization
The most interesting customizable features are:

* Ability to skip intermediate view controllers when tapped on a "tab".
* Indicators can be added at any position of the screen through storyboard layouts.
* Indicators can be added at any position of the screen through storyboard layouts.
* Choose between progressive, non-progressive indicators.
* Add space padding between view controllers.


Expand Down
4 changes: 2 additions & 2 deletions XLPagerTabStrip.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Pod::Spec.new do |s|
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'PagerTabStrip for iOS and much more!'
s.description = <<-DESC
s.description = <<-DESC
Android PagerTabStrip for iOS and much more
DESC
s.homepage = 'https://github.com/xmartlabs/XLPagerTabStrip'
s.authors = { 'Martin Barreto' => '[email protected]', 'Washington Miranda' => '[email protected]' }
s.source = { :git => 'https://github.com/xmartlabs/XLPagerTabStrip.git', :tag => 'v1.0.0' }
s.source_files = 'XLPagerTabStrip/XL/**/*.{h,m}'
s.requires_arc = true
s.ios.deployment_target = '7.0'
s.ios.deployment_target = '7.1'
s.ios.frameworks = 'UIKit', 'Foundation'
end
22 changes: 7 additions & 15 deletions XLPagerTabStrip.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
28B63ADC1A45A4CD00225C66 /* XLBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63ACF1A45A4CD00225C66 /* XLBarView.m */; };
28B63ADD1A45A4CD00225C66 /* XLButtonBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AD11A45A4CD00225C66 /* XLButtonBarView.m */; };
28B63ADE1A45A4CD00225C66 /* XLButtonBarViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AD31A45A4CD00225C66 /* XLButtonBarViewCell.m */; };
28B63AE51A45A8EE00225C66 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28B63AE31A45A8EE00225C66 /* LaunchScreen.xib */; };
28B63AEF1A45B26600225C66 /* XLBarPagerTabStripViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AE81A45B26600225C66 /* XLBarPagerTabStripViewController.m */; };
28B63AF01A45B26600225C66 /* XLButtonBarPagerTabStripViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AEA1A45B26600225C66 /* XLButtonBarPagerTabStripViewController.m */; };
28B63AF11A45B26600225C66 /* XLPagerTabStripViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B63AEC1A45B26600225C66 /* XLPagerTabStripViewController.m */; };
Expand Down Expand Up @@ -76,7 +75,6 @@
28B63AD11A45A4CD00225C66 /* XLButtonBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLButtonBarView.m; sourceTree = "<group>"; };
28B63AD21A45A4CD00225C66 /* XLButtonBarViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLButtonBarViewCell.h; sourceTree = "<group>"; };
28B63AD31A45A4CD00225C66 /* XLButtonBarViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLButtonBarViewCell.m; sourceTree = "<group>"; };
28B63AE41A45A8EE00225C66 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = XLPagerTabStrip/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; };
28B63AE71A45B26600225C66 /* XLBarPagerTabStripViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLBarPagerTabStripViewController.h; path = Controllers/XLBarPagerTabStripViewController.h; sourceTree = "<group>"; };
28B63AE81A45B26600225C66 /* XLBarPagerTabStripViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLBarPagerTabStripViewController.m; path = Controllers/XLBarPagerTabStripViewController.m; sourceTree = "<group>"; };
28B63AE91A45B26600225C66 /* XLButtonBarPagerTabStripViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLButtonBarPagerTabStripViewController.h; path = Controllers/XLButtonBarPagerTabStripViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -185,7 +183,6 @@
C262204C1AD44A4D002E5226 /* TwitterExampleViewController.h */,
C262204D1AD44A4D002E5226 /* TwitterExampleViewController.m */,
28B63ABF1A45A4C500225C66 /* PagerSlidingTabStrip.gif */,
28B63AE31A45A8EE00225C66 /* LaunchScreen.xib */,
28B63AC21A45A4C500225C66 /* Storyboard.storyboard */,
);
path = Demo;
Expand Down Expand Up @@ -320,6 +317,7 @@
TargetAttributes = {
28B63A851A459F5900225C66 = {
CreatedOnToolsVersion = 6.1.1;
DevelopmentTeam = 6F2G55XL63;
};
28B63A9E1A459F5900225C66 = {
CreatedOnToolsVersion = 6.1.1;
Expand Down Expand Up @@ -351,7 +349,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28B63AE51A45A8EE00225C66 /* LaunchScreen.xib in Resources */,
28B63AC91A45A4C500225C66 /* PagerSlidingTabStrip.gif in Resources */,
28B63A971A459F5900225C66 /* Images.xcassets in Resources */,
28B63ACB1A45A4C500225C66 /* Storyboard.storyboard in Resources */,
Expand Down Expand Up @@ -413,17 +410,6 @@
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
28B63AE31A45A8EE00225C66 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
28B63AE41A45A8EE00225C66 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
28B63AA71A459F5900225C66 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -505,7 +491,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = XLPagerTabStrip/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -515,7 +504,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = XLPagerTabStrip/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
Binary file modified XLPagerTabStrip/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions XLPagerTabStrip/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[XLJSONSerialization sharedInstance] postsData];
[application setStatusBarStyle:UIStatusBarStyleLightContent];
return YES;

}
Expand Down
47 changes: 0 additions & 47 deletions XLPagerTabStrip/Base.lproj/LaunchScreen.xib

This file was deleted.

16 changes: 6 additions & 10 deletions XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,15 @@ - (IBAction)reloadTapped:(id)sender {

-(void)updateTitle:(XLPagerTabStripViewController *)pagerController
{
NSString * title = @"isProgressiveIndicator = NO";
if (pagerController.isProgressiveIndicator){
if (pagerController.isElasticIndicatorLimit){
title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = YES";
}
else{
title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = NO";
}
}

NSString * title = [NSString stringWithFormat:@"Progressive = %@ ElasticLimit = %@",[self stringFromBool:pagerController.isProgressiveIndicator] ,[self stringFromBool:pagerController.isElasticIndicatorLimit]];
self.titleLabel.text = title;
((UILabel *)self.navigationItem.titleView).text = title;
[((UILabel *)self.navigationItem.titleView) sizeToFit];
}

-(NSString *)stringFromBool:(BOOL)value
{
return value ? @"YES" : @"NO";
}

@end
22 changes: 15 additions & 7 deletions XLPagerTabStrip/Demo/Storyboard.storyboard
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="ptL-BW-nEP">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="ptL-BW-nEP">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
Expand All @@ -19,7 +20,7 @@
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D5t-1q-KDh">
<rect key="frame" x="0.0" y="0.0" width="600" height="487"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -87,8 +88,8 @@
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Storyboard Demo" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="cZN-qT-VUq">
<rect key="frame" x="207" y="52" width="187" height="28"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="23"/>
<rect key="frame" x="230" y="52" width="140" height="21"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
Expand Down Expand Up @@ -192,7 +193,7 @@
</view>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" alwaysBounceHorizontal="YES" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gaM-gk-dVJ">
<rect key="frame" x="0.0" y="5" width="600" height="425"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -272,6 +273,7 @@
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.027450980390000001" green="0.72549019609999998" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes">
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
Expand Down Expand Up @@ -337,7 +339,7 @@
</collectionView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mcV-6K-P6b" customClass="UIScrollView">
<rect key="frame" x="-5" y="43" width="610" height="444"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -375,7 +377,7 @@
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A96-PT-Aon">
<rect key="frame" x="0.0" y="0.0" width="600" height="487"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
Expand All @@ -389,6 +391,12 @@
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<navigationItem key="navigationItem" id="0Xx-RA-ktC">
<nil key="title"/>
<barButtonItem key="rightBarButtonItem" systemItem="refresh" id="mhz-8g-Ux7">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="reloadTapped:" destination="Vhq-do-uI2" id="C47-dn-jtz"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="containerView" destination="A96-PT-Aon" id="7oh-72-sHX"/>
Expand Down
5 changes: 5 additions & 0 deletions XLPagerTabStrip/Demo/TwitterExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ -(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripV
return [childViewControllers subarrayWithRange:NSMakeRange(0, nItems)];
}

- (IBAction)reloadTapped:(id)sender {
_isReload = YES;
[self reloadPagerTabStripView];
}

@end
21 changes: 0 additions & 21 deletions XLPagerTabStrip/Images.xcassets/Launch.imageset/Contents.json

This file was deleted.

Loading

0 comments on commit 43d9302

Please sign in to comment.