:arrow_up: A Modal Presentation Controller that adapts to content size, keyboard visibility, and touch input.
https://github.com/calda/AdaptiveFormSheet.git
AdaptiveFormSheet in your own projects through Carthage.
Add github "calda/AdaptiveFormSheet" to your Cartfile and run carthage update.
If your View Controller subclasses AFSModalViewController, presentations from segues or through UIViewController.present(_:animated:completion:) will automatically adopt this presentation style:
import AdaptiveFormSheet
class MyModelViewController: AFSModalViewController {
...
}
AdaptiveFormSheet uses preferredContentSize to decide how large to make your modal. It may be able to infer this automatically, but you can also override the property in your subclass to define it explicitly:
override var preferredContentSize: CGSize {
get { return CGSize(width: 300, height: 450) }
set { }
}