Create your own pull up controller with multiple sticky points like in iOS Maps.

PullUpController

Features

  • Multiple sticky points
  • Landscape support
  • Scroll views friendly

Setup

  1. Add pod 'PullUpController' to your Podfile or copy PullUpController.swift into your project
  2. Make sure the view controller that will be your pull up controller inherits from PullUpController
  3. Add the controller as child of your main controller using addPullUpController(<#T##PullUpController#>, initialStickyPointOffset: <#T##CGFloat#>, animated: <#T##Bool#>)

Customization

You can customize the controller behavior by overriding the followings properties:

pullUpControllerPreferredSize: CGSize

The desired size of the pull up controller’s view, in screen units.

The default value is width: UIScreen.main.bounds.width, height: 400.

pullUpControllerPreferredLandscapeFrame: CGRect

The desired size of the pull up controller’s view, in screen units when the device is in landscape mode.

The default value is (x: 10, y: 10, width: 300, height: UIScreen.main.bounds.height - 20).

pullUpControllerMiddleStickyPoints: [CGFloat]

A list of y values, in screen units expressed in the pull up controller coordinate system.

At the end of the gestures the pull up controller will scroll to the nearest point in the list.

For a complete list of all the sticky points you can use pullUpControllerAllStickyPoints

#maps #ios

Pull up controller with multiple sticky points like in iOS Maps
8.50 GEEK