SheetViewController

Customizable native-like sheet alert controller with three action types: separately, inner, none.

Demo

Separately action type

let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .separately)

Portrait

separately_portrait

Landscape

separately_landscape

Inner action type

let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .inner)

Portrait

inner_portrait

Landscape

inner_landscape

None action type

let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .none)

Portrait

none_portrait

Landscape

none_landscape

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

SheetViewController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

inhibit_all_warnings!

target 'YOUR-TARGET-NAME' do
  use_frameworks!
	pod 'SheetViewController'
end

Usage

// 'titleMessage' - title for alert.
// 'message' - message for alert.
// 'cancelTitle' - title for bottom button.
// 'cancelHandler' - the handler of bottom button click.
//
// 'customRowView' - the object of class 'UIView' or his inheritors.
// 'row' - the object of class 'SheetItemActionView'.

let alert = SheetViewController.alert(with: titleMessage, message: message, actionType: .inner)
alert.setCancelButton(title: cancelTitle, and: cancelHandler)

alert.addView(customRowView)
alert.addRow(actionView: row)

present(alert, animated: true, completion: nil)

Author

Anton Yereshchenko

GitHub