You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Before contribute check the [CONTRIBUTING](CONTRIBUTING.md) file for more info.**
37
37
38
-
If you use **XLPagerTabStrip** in your app We would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).
38
+
If you use **XLPagerTabStrip** in your app we would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).
39
39
40
40
## Pager Types
41
41
42
42
The library provides 4 different ways to show the view controllers.
43
43
44
44
### Button Bar
45
45
46
-
This is likely to be the most common pager type. It's used by many wellknown apps such as instagram, youtube, skype and many others.
46
+
This is likely the most common pager type. It's used by many well-known apps such as instagram, youtube, skype, and many others.
47
47
48
48
<imgsrc="Example/barButton.gif"width="250"/>
49
49
@@ -55,28 +55,28 @@ This mode doesn't show a title neither an image. It only shows a bar that indica
55
55
56
56
### Twitter
57
57
58
-
Long time ago twitter app made use of this type of pager in the app main screen.
58
+
A long time ago, the twitter app made use of this type of pager in the app main screen.
59
59
60
60
<imgsrc="Example/twitter.gif"width="250"/>
61
61
62
62
### Segmented
63
63
64
-
This mode uses a `UISegmentedControl` to indicates which is the view controller being displayed.
64
+
This mode uses a `UISegmentedControl` to indicate which view controller is being displayed.
65
65
66
66
<imgsrc="Example/segmented.gif"width="250"/>
67
67
68
68
## Usage
69
69
70
-
Basically we just need to provide the list of child view controllers to show and these view controllers should provide the information (title or image) that will be shown in the associated indicator.
70
+
Basically, we just need to provide the list of child view controllers to show, and these view controllers should provide the information (title or image) that will be shown in the associated indicator.
71
71
72
72
Let's see the steps to do this:
73
73
74
74
##### Choose which type of pager we want to create
75
75
76
-
First we should choose the type of pager we want to create, depending on our choice we will have to create a view controller that extends from one of the following controllers: `TwitterPagerTabStripViewController`, `ButtonBarPagerTabStripViewController`, `SegmentedPagerTabStripViewController`, `BarPagerTabStripViewController`.
76
+
First, we must choose the type of pager we want to create. Depending on our choice, we will have to create a view controller that extends from one of the following controllers: `TwitterPagerTabStripViewController`, `ButtonBarPagerTabStripViewController`, `SegmentedPagerTabStripViewController`, `BarPagerTabStripViewController`.
77
77
78
-
> All these build-in pager controllers extend from the base class `PagerTabStripViewController`.
79
-
> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in case no pager menu type fits your needs.
78
+
> All these built-in pager controllers extend from the base class `PagerTabStripViewController`.
79
+
> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in the event that no pager menu type fits your needs.
80
80
81
81
```swift
82
82
importXLPagerTabStrip
@@ -88,14 +88,14 @@ class MyPagerTabStripName: ButtonBarPagerTabStripViewController {
88
88
89
89
##### Connect outlets and add layout constraints
90
90
91
-
We strongly recommend to use IB to set up our page controller views.
91
+
We strongly recommend using IB to set up our page controller views.
92
92
93
-
Drag into the storyboard a `UIViewController` and set up its class with your pager controller (`MyPagerTabStripName`).
93
+
Drag a `UIViewController` into the storyboard and set up its class with your pager controller (`MyPagerTabStripName`).
94
94
Drag a `UIScrollView` into your view controller view and connect `PagerTabStripViewController``containerView` outlet with the scroll view.
95
95
96
96
Depending on which type of paging view controller you are working with you may have to connect more outlets.
97
97
98
-
For `BarPagerTabStripViewController` we should connect `barView` outlet. barView type is UIView. `ButtonBarPagerTabStripViewController` requires us to connect `buttonBarView` outlet. `buttonBarView` type is `ButtonBarView` which extends from `UICollectionView`. `SegmentedPagerTabStripViewController` has a `segmentedControl` outlet, if the outlet is not connected the library try to set up the navigationItem `titleView` property using a `UISegmentedControl`. `TwitterPagerTabStripViewController` doesn't require us to connect any additional outlet.
98
+
For `BarPagerTabStripViewController`, we should connect `barView` outlet. barView type is UIView. `ButtonBarPagerTabStripViewController` requires us to connect `buttonBarView` outlet. `buttonBarView` type is `ButtonBarView` which extends from `UICollectionView`. `SegmentedPagerTabStripViewController` has a `segmentedControl` outlet; if the outlet is not connected the library try to set up the navigationItem `titleView` property using a `UISegmentedControl`. `TwitterPagerTabStripViewController` doesn't require us to connect any additional outlet.
99
99
100
100
> The example project contains a example for each pager controller type and we can look into it to see how views were added and how outlets were connected.
101
101
@@ -127,7 +127,7 @@ class MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider {
127
127
}
128
128
```
129
129
130
-
**For a detailed step by step guide about how to use the library, please check out this community [blog post](https://medium.com/michaeladeyeri/how-to-implement-android-like-tab-layouts-in-ios-using-swift-3-578516c3aa9).**
130
+
**For a detailed step-by-step guide about how to use the library, please check out this community [blog post](https://medium.com/michaeladeyeri/how-to-implement-android-like-tab-layouts-in-ios-using-swift-3-578516c3aa9).**
As you might have noticed `common` and `progressive` enumeration cases has`skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.
165
+
As you might have noticed,`common` and `progressive` enumeration cases have`skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.
166
166
167
167
`skipIntermediateViewControllers` allows us to skip intermediate view controllers when a tab indicator is tapped.
168
168
169
169
`elasticIndicatorLimit` allows us to tension the indicator when we reach a limit, I mean when we try to move forward from last indicator or move back from first indicator.
Normally we don't need to implement these protocols because each pager type already conforms to it in order to properly update its indicator. Anyway there may be some scenarios when overriding a method come come in handy.
173
+
Normally we don't need to implement these protocols because each pager type already conforms to it in order to properly update its indicator. However, there may be some scenarios when overriding a method may come in handy.
174
174
175
175
```swift
176
176
publicprotocolPagerTabStripDelegate: class {
@@ -184,7 +184,7 @@ public protocol PagerTabStripIsProgressiveDelegate : PagerTabStripDelegate {
184
184
}
185
185
```
186
186
187
-
> Again, The method invoked by the library depends on the `pagerBehaviour` value.
187
+
> Again, the method invoked by the library depends on the `pagerBehaviour` value.
0 commit comments