Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readme wording #667

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix wording in a few places
e.g. missing commas, verb tense correction, and the like.
  • Loading branch information
ajRiverav committed Nov 27, 2018
commit c284706fe9ec326d5d9ef98b49c41cbedb0be291
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 35,15 @@ Android [PagerTabStrip](http://developer.android.com/reference/android/support/v

**Before contribute check the [CONTRIBUTING](CONTRIBUTING.md) file for more info.**

If you use **XLPagerTabStrip** in your app We would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).
If you use **XLPagerTabStrip** in your app we would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).

## Pager Types

The library provides 4 different ways to show the view controllers.

### Button Bar

This is likely to be the most common pager type. It's used by many well known apps such as instagram, youtube, skype and many others.
This is likely the most common pager type. It's used by many well-known apps such as instagram, youtube, skype, and many others.

<img src="Example/barButton.gif" width="250"/>

Expand All @@ -55,28 55,28 @@ This mode doesn't show a title neither an image. It only shows a bar that indica

### Twitter

Long time ago twitter app made use of this type of pager in the app main screen.
A long time ago, the twitter app made use of this type of pager in the app main screen.

<img src="Example/twitter.gif" width="250"/>

### Segmented

This mode uses a `UISegmentedControl` to indicates which is the view controller being displayed.
This mode uses a `UISegmentedControl` to indicate which view controller is being displayed.

<img src="Example/segmented.gif" width="250"/>

## Usage

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.
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.

Let's see the steps to do this:

##### Choose which type of pager we want to create

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`.
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`.

> All these build-in pager controllers extend from the base class `PagerTabStripViewController`.
> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in case no pager menu type fits your needs.
> All these built-in pager controllers extend from the base class `PagerTabStripViewController`.
> You can also make your custom pager controller by extending directly from `PagerTabStripViewController` in the event that no pager menu type fits your needs.

```swift
import XLPagerTabStrip
Expand All @@ -88,14 88,14 @@ class MyPagerTabStripName: ButtonBarPagerTabStripViewController {

##### Connect outlets and add layout constraints

We strongly recommend to use IB to set up our page controller views.
We strongly recommend using IB to set up our page controller views.

Drag into the storyboard a `UIViewController` and set up its class with your pager controller (`MyPagerTabStripName`).
Drag a `UIViewController` into the storyboard and set up its class with your pager controller (`MyPagerTabStripName`).
Drag a `UIScrollView` into your view controller view and connect `PagerTabStripViewController` `containerView` outlet with the scroll view.

Depending on which type of paging view controller you are working with you may have to connect more outlets.

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.
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.

> 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.

Expand Down Expand Up @@ -127,7 127,7 @@ class MyEmbeddedViewController: UITableViewController, IndicatorInfoProvider {
}
```

**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).**
**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).**

That's it! We're done! 🍻🍻

Expand Down Expand Up @@ -162,15 162,15 @@ PagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasti
PagerTabStripBehaviour.progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true)
```

As you might have noticed `common` and `progressive` enumeration cases has `skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.
As you might have noticed, `common` and `progressive` enumeration cases have `skipIntermediateViewControllers` and `elasticIndicatorLimit` associated values.

`skipIntermediateViewControllers` allows us to skip intermediate view controllers when a tab indicator is tapped.

`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.

##### PagerTabStripDelegate & PagerTabStripIsProgressiveDelegate

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.
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.

```swift
public protocol PagerTabStripDelegate: class {
Expand All @@ -184,7 184,7 @@ public protocol PagerTabStripIsProgressiveDelegate : PagerTabStripDelegate {
}
```

> Again, The method invoked by the library depends on the `pagerBehaviour` value.
> Again, the method invoked by the library depends on the `pagerBehaviour` value.



Expand Down