Skip to content

Commit cde2165

Browse files
author
Erik Malyak
committed
Updated for CocoaDocs
1 parent 805279c commit cde2165

File tree

1 file changed

+14
-236
lines changed

1 file changed

+14
-236
lines changed

README.md

Lines changed: 14 additions & 236 deletions
Original file line numberDiff line numberDiff line change
@@ -32,250 +32,28 @@ source 'https://github.com/CocoaPods/Specs.git'
3232
platform :ios, '8.0'
3333
use_frameworks!
3434

35-
pod 'EMPageViewController', '2.0.0-beta.1'
35+
pod 'EMPageViewController'
3636
```
3737

3838
### File include
39-
Simply include the file [EMPageViewController.swift](EMPageViewController/EMPageViewController.swift) into your project.
39+
Simply include the file [EMPageViewController.swift](https://github.com/emalyak/EMPageViewController/blob/master/EMPageViewController/EMPageViewController.swift) into your project.
4040

4141
## Example usage / Demo
42-
Learn how to use EMPageViewController in your project by cloning this repository and opening the Xcode project file *Greetings.xcodeproj* in [Examples/Greetings](Examples/Greetings). The code for initializing EMPageViewController and implementing its delegate and data source is located in [RootViewController.swift](Examples/Greetings/Greetings/RootViewController.swift).
42+
Learn how to use EMPageViewController in your project by cloning this repository and opening the Xcode project file *Greetings.xcodeproj* in [Examples/Greetings](https://github.com/emalyak/EMPageViewController/blob/master/Examples/Greetings). The code for initializing EMPageViewController and implementing its delegate and data source is located in [RootViewController.swift](https://github.com/emalyak/EMPageViewController/blob/master/Examples/Greetings/Greetings/RootViewController.swift).
4343

4444
## Documentation
45+
Full documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/EMPageViewController)
4546

46-
* [EMPageViewController](#empageviewcontroller-1)
47-
* [Properties](#properties)
48-
* [dataSource](#datasource)
49-
* [delegate](#delegate)
50-
* [Methods](#methods)
51-
* [selectViewController:direction:animated:completion:](#selectviewcontrollerdirectionanimatedcompletion)
52-
* [scrollForwardAnimated:completion:](#scrollforwardanimatedcompletion)
53-
* [scrollReverseAnimated:completion:](#scrollreverseanimatedcompletion)
47+
### Classes
48+
* [EMPageViewController](http://cocoadocs.org/docsets/EMPageViewController/2.0.0/Classes/EMPageViewController.html)
5449

55-
* [EMPageViewControllerDataSource](#empageviewcontrollerdatasource)
56-
* [em_pageViewController:viewControllerBeforeViewController:](#em_pageviewcontrollerviewcontrollerbeforeviewcontroller)
57-
* [em_pageViewController:viewControllerAfterViewController:](#em_pageviewcontrollerviewcontrollerafterviewcontroller)
50+
### Enums
51+
* [EMPageViewControllerNavigationDirection](http://cocoadocs.org/docsets/EMPageViewController/2.0.0/Enums/EMPageViewControllerNavigationDirection.html)
52+
* [EMPageViewControllerNavigationOrientation](http://cocoadocs.org/docsets/EMPageViewController/2.0.0/Enums/EMPageViewControllerNavigationOrientation.html)
5853

59-
* [EMPageViewControllerDelegate](#empageviewcontrollerdelegate)
60-
* [em_pageViewController:willStartScrollingFrom:destinationViewController:](#em_pageviewcontrollerwillstartscrollingfromdestinationviewcontroller)
61-
* [em_pageViewController:isScrollingFrom:destinationViewController:progress:](#em_pageviewcontrollerisscrollingfromdestinationviewcontrollerprogress)
62-
* [em_pageViewController:didFinishScrollingFrom:destinationViewController:transitionSuccessful:](#em_pageviewcontrollerdidfinishscrollingfromdestinationviewcontrollertransitionsuccessful)
63-
64-
### EMPageViewController
65-
`EMPageViewController` allows for page navigation through different view controllers, or "pages". View controllers can be navigated via swiping gestures, or called programmatically.
66-
67-
#### Properties
68-
69-
Properties for providing view controllers and receiving messages during navigation.
70-
71-
* * *
72-
73-
##### `dataSource`
74-
75-
The object that provides view controllers on an as-needed basis throughout the navigation of the page view controller. If the data source is `nil`, gesture based scrolling will be disabled and all view controllers must be provided through `selectViewController:direction:animated:completion:`.
76-
77-
**Important**
78-
79-
If you are using a data source, make sure you set `dataSource` before calling `selectViewController:direction:animated:completion:`
80-
81-
**Declaration**
82-
```swift
83-
weak var dataSource:EMPageViewControllerDataSource!
84-
```
85-
86-
* * *
87-
88-
##### `delegate`
89-
90-
The object that receives messages throughout the navigation of the page view controller.
91-
92-
**Declaration**
93-
```swift
94-
weak var delegate:EMPageViewControllerDelegate?
95-
```
96-
97-
* * *
98-
99-
#### Methods
100-
101-
Methods for initializing and navigating the page view controller.
102-
103-
* * *
104-
105-
##### `selectViewController:direction:animated:completion:`
106-
107-
Sets the view controller that will be selected after the animation. This method is also used to provide the first view controller that will be selected in the page view controller. If a data source has been set, the view controllers before and after the selected view controller will also be loaded but not appear yet.
108-
109-
**Important**
110-
111-
If you are using a data source, make sure you set `dataSource` before calling `selectViewController:direction:animated:completion:`
112-
113-
**Declaration**
114-
```swift
115-
func selectViewController(viewController: UIViewController, direction: EMPageViewControllerNavigationDirection, animated: Bool, completion: ((transitionSuccessful: Bool) -> Void)?)
116-
```
117-
118-
Parameter | Description
119-
---------------------- | --------------------------------------
120-
`selectViewController` | The view controller to be selected
121-
`direction` | The direction of the navigation and animation if applicable
122-
`animated` | A Boolean whether or not to animate the transition
123-
`completion` | A block that's called after the transition is finished. The block parameter `transitionSuccessful` is true if the transition to the selected view controller was completed successfully.
124-
125-
* * *
126-
127-
##### `scrollForwardAnimated:completion:`
128-
129-
Transitions to the view controller right of the currently selected view controller in a horizontal orientation, or below the currently selected view controller in a vertical orientation. Also described as going to the next page.
130-
131-
**Declaration**
132-
```swift
133-
func scrollForwardAnimated(animated: Bool, completion: ((transitionSuccessful: Bool) -> Void)?)
134-
```
135-
136-
Parameter | Description
137-
------------- | --------------------------------------
138-
`animated` | A Boolean whether or not to animate the transition
139-
`completion` | A block that's called after the transition is finished. The block parameter `transitionSuccessful` is `true` if the transition to the selected view controller was completed successfully. If `false`, the transition returned to the view controller it started from.
140-
141-
* * *
142-
143-
##### `scrollReverseAnimated:completion:`
144-
145-
Transitions to the view controller left of the currently selected view controller in a horizontal orientation, or above the currently selected view controller in a vertical orientation. Also described as going to the previous page.
146-
147-
**Declaration**
148-
```swift
149-
func scrollReverseAnimated(animated: Bool, completion: ((transitionSuccessful: Bool) -> Void)?)
150-
```
151-
152-
Parameter | Description
153-
------------- | --------------------------------------
154-
`animated` | A Boolean whether or not to animate the transition
155-
`completion` | A block that's called after the transition is finished. The block parameter `transitionSuccessful` is `true` if the transition to the selected view controller was completed successfully. If `false`, the transition returned to the view controller it started from.
156-
157-
* * *
158-
159-
### EMPageViewControllerDataSource
160-
The `EMPageViewControllerDataSource` protocol is adopted to provide the view controllers that are displayed when the user scrolls through pages. Methods are called on an as-needed basis.
161-
162-
Each method returns a UIViewController object or `nil` if there are no view controllers to be displayed.
163-
164-
If the data source is `nil`, gesture based scrolling will be disabled and all view controllers must be provided through `selectViewController:direction:animated:completion:`.
165-
166-
* * *
167-
168-
##### `em_pageViewController:viewControllerBeforeViewController:`
169-
170-
Called to optionally return a view controller that is to the left of a given view controller in a horizontal orientation, or above a given view controller in a vertical orientation.
171-
172-
**Declaration**
173-
```swift
174-
func em_pageViewController(pageViewController: EMPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController?
175-
```
176-
**Parameters**
177-
178-
Parameter | Description
179-
-------------------- | --------------------------------------
180-
`pageViewController` | The page view controller
181-
`viewController` | The point of reference view controller
182-
183-
**Return value**
184-
185-
The view controller that is to the left of the given `viewController` in a horizontal orientation, or above the given `viewController` in a vertical orientation, or `nil` if there is no view controller to be displayed.
186-
187-
* * *
188-
189-
##### `em_pageViewController:viewControllerAfterViewController:`
190-
191-
Called to optionally return a view controller that is to the right of a given view controller.
192-
193-
**Declaration**
194-
```swift
195-
func em_pageViewController(pageViewController: EMPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController?
196-
```
197-
**Parameters**
198-
199-
Parameter | Description
200-
-------------------- | --------------------------------------
201-
`pageViewController` | The page view controller
202-
`viewController` | The point of reference view controller
203-
204-
**Return value**
205-
206-
The view controller that is to the right of the given `viewController` in a horizontal orientation, or below the given `viewController` in a vertical orientation, or `nil` if there is no view controller to be displayed.
207-
208-
* * *
209-
210-
### EMPageViewControllerDelegate
211-
212-
The `EMPageViewControllerDelegate` protocol is adopted to receive messages for all major events of the page transition process.
213-
214-
* * *
215-
216-
##### `em_pageViewController:willStartScrollingFrom:destinationViewController:`
217-
218-
Called before scrolling to a new view controller.
219-
220-
This method will not be called if the start view controller is `nil`. A common scenario where this will occur is when you initialize the page view controller and use `selectViewController:direction:animated:completion:` to load the first controller.
221-
222-
**Declaration**
223-
```swift
224-
optional func em_pageViewController(pageViewController: EMPageViewController, willStartScrollingFrom startViewController: UIViewController, destinationViewController: UIViewController)
225-
```
226-
227-
**Parameters**
228-
229-
Parameter | Description
230-
--------------------------- | --------------------------------------
231-
`pageViewController` | The page view controller
232-
`startViewController` | The currently selected view controller the transition is starting from
233-
`destinationViewController` | The view controller being scrolled to where the transition will end
234-
235-
**Note**
236-
If bouncing is enabled, it is possible this method will be called more than once for one page transition. It can be called before the initial scroll to the destination view controller (which is when it is usually called), and it can also be called when the scroll momentum carries over slightly to the view controller after the original destination view controller.
237-
238-
* * *
239-
240-
##### `em_pageViewController:isScrollingFrom:destinationViewController:progress:`
241-
242-
Called whenever there has been a scroll position change in a page transition. This method is very useful if you need to know the exact progress of the page transition animation.
243-
244-
This method will not be called if the start view controller is `nil`. A common scenario where this will occur is when you initialize the page view controller and use `selectViewController:direction:animated:completion:` to load the first controller.
245-
246-
**Declaration**
247-
```swift
248-
optional func em_pageViewController(pageViewController: EMPageViewController, isScrollingFrom startViewController: UIViewController, destinationViewController: UIViewController, progress: CGFloat)
249-
```
250-
251-
**Parameters**
252-
253-
Parameter | Description
254-
--------------------------- | --------------------------------------
255-
`pageViewController` | The page view controller
256-
`startViewController` | The currently selected view controller the transition is starting from
257-
`destinationViewController` | The view controller being scrolled to where the transition will end
258-
`progress` | The progress of the transition, where 0 is a neutral scroll position, >= 1 is a complete transition to the right view controller in a horizontal orientation, or the below view controller in a vertical orientation, and <= -1 is a complete transition to the left view controller in a horizontal orientation, or the above view controller in a vertical orientation. Values may be greater than 1 or less than -1 if the scroll velocity is quick enough.
259-
260-
* * *
261-
262-
##### `em_pageViewController:didFinishScrollingFrom:destinationViewController:transitionSuccessful:`
263-
264-
Called after a page transition attempt has completed.
265-
266-
**Declaration**
267-
```swift
268-
optional func em_pageViewController(pageViewController: EMPageViewController, didFinishScrollingFrom startViewController: UIViewController?, destinationViewController: UIViewController, transitionSuccessful: Bool)
269-
```
270-
271-
**Parameters**
272-
273-
Parameter | Description
274-
--------------------------- | --------------------------------------
275-
`pageViewController` | The page view controller
276-
`startViewController` | The currently selected view controller the transition is starting from
277-
`destinationViewController` | The view controller that was been attempted to be selected
278-
`transitionSuccessful` | A Boolean whether the transition to the destination view controller was successful or not. If `true`, the new selected view controller is `destinationViewController`. If `false`, the transition returned to the view controller it started from, so the selected view controller is `startViewController`.
54+
### Protocols
55+
* [EMPageViewControllerDataSource](http://cocoadocs.org/docsets/EMPageViewController/2.0.0/Protocols/EMPageViewControllerDataSource.html)
56+
* [EMPageViewControllerDelegate](http://cocoadocs.org/docsets/EMPageViewController/2.0.0/Protocols/EMPageViewControllerDelegate.html)
27957

28058
* * *
28159

@@ -284,6 +62,6 @@ Parameter | Description
28462
Feedback? Suggestions? Just want to say hello? Contact me anytime on Twitter [@emalyak](https://twitter.com/emalyak). You can also visit my website [erikmalyak.com](http://erikmalyak.com) for other ways to get in touch.
28563

28664
## License
287-
Copyright (c) 2015 [Erik Malyak](http://erikmalyak.com)
65+
Copyright (c) 2015-2016 [Erik Malyak](http://erikmalyak.com)
28866

289-
[MIT License](LICENSE)
67+
[MIT License](https://github.com/emalyak/EMPageViewController/blob/master/LICENSE)

0 commit comments

Comments
 (0)