Skip to content

Commit 26e254e

Browse files
committed
Update readme
1 parent 14df11d commit 26e254e

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ Create your own pull up controller with multiple sticky points like in iOS Maps
1717
# Setup
1818
1. Add `pod 'PullUpController'` to your Podfile or copy `PullUpController.swift` into your project
1919
2. Make sure the view controller that will be your pull up controller inherits from `PullUpController`
20-
3. Add the controller as child of your main controller using `addPullUpController(<#T##PullUpController#>)`
20+
3. Add the controller as child of your main controller using `addPullUpController(<#T##PullUpController#>, initialStickyPointOffset: <#T##CGFloat#>, animated: <#T##Bool#>)`
2121

2222
# Customization
2323
You can customize the controller behavior by overriding the followings properties:
2424

25-
`pullUpControllerPreviewOffset: CGFloat`
26-
>The desired height in screen units expressed in the pull up controller coordinate system that will be initially showed.
27-
>The default value is ```50```
28-
2925
`pullUpControllerPreferredSize: CGSize`
3026
>The desired size of the pull up controller’s view, in screen units.
3127
>The default value is width: `UIScreen.main.bounds.width, height: 400`.
3228
29+
`pullUpControllerPreferredLandscapeFrame: CGRect`
30+
>The desired size of the pull up controller’s view, in screen units when the device is in landscape mode.
31+
>The default value is `(x: 10, y: 10, width: 300, height: UIScreen.main.bounds.height - 20)`.
32+
3333
`pullUpControllerMiddleStickyPoints: [CGFloat]`
3434
>A list of y values, in screen units expressed in the pull up controller coordinate system.
3535
>At the end of the gestures the pull up controller will scroll to the nearest point in the list.
@@ -39,19 +39,11 @@ You can customize the controller behavior by overriding the followings propertie
3939
>
4040
>For a complete list of all the sticky points you can use `pullUpControllerAllStickyPoints`
4141
42-
`pullUpControllerAllStickyPoints: [CGFloat]`
43-
>A list of y values, in screen units expressed in the pull up controller coordinate system.
44-
>At the end of the gesture the pull up controller will scroll at the nearest point in the list.
45-
4642
`pullUpControllerIsBouncingEnabled: Bool`
4743
>A Boolean value that determines whether bouncing occurs when scrolling reaches the end of the pull up controller's view size.
4844
>The default value is `false`.
4945
50-
`pullUpControllerPreferredLandscapeFrame: CGRect`
51-
>The desired size of the pull up controller’s view, in screen units when the device is in landscape mode.
52-
>The default value is `(x: 10, y: 10, width: 300, height: UIScreen.main.bounds.height - 20)`.
53-
54-
It's possible to change the view controller's view position by using the method
46+
It's possible to change the view controller's view position programmatically by using the method
5547
`pullUpControllerMoveToVisiblePoint(_ visiblePoint: CGFloat, completion: (() -> Void)?)`
5648

5749
>This method will move the pull up controller's view in order to show the provided visible point.
@@ -60,6 +52,15 @@ It's possible to change the view controller's view position by using the method
6052
>- `visiblePoint`: the y value to make visible, in screen units expressed in the pull up controller coordinate system.
6153
>- `completion`: The closure to execute after the animation is completed. This block has no return value and takes no parameters. You may specify nil for this parameter.
6254
55+
By overriding the following method it is possible to customize all the animations performed by the controller's view.
56+
57+
`pullUpControllerAnimate(withDuration duration: TimeInterval, animations: @escaping () -> Void, completion: ((Bool) -> Void)?)`
58+
59+
To observe the PullUpController's view state there're some usefull callbacks such as:
60+
- `willMoveToStickyPoint: ((_ point: CGFloat) -> Void)?`
61+
- `didMoveToStickyPoint: ((_ point: CGFloat) -> Void)?`
62+
- `onDrag: ((_ point: CGFloat) -> Void)?`
63+
6364
PullUpController is easy draggable even if your `PullUpController`'s view contains a `UIScrollView`, just attach it to the controller itself with the following method:
6465
`<#T##UIScrollView#>.attach(to: <#T##PullUpController#>)`
6566
>Attach the scroll view to the provided pull up controller in order to move it with the scroll view content.

0 commit comments

Comments
 (0)