SheetViewController
About
Customizable native-like sheet alert controller with three action types: separately, inner, none.
Demo
Interaction with SheetViewController
that have .inner
action type:
Separately action type
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .separately)
Portrait
Landscape
Inner action type
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .inner)
Portrait
Landscape
None action type
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .none)
Portrait
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
License
SheetViewController is available under the MIT license. See the LICENSE file for more info.
Inspired by
Designing for iPhone in Figma - https://setproduct.com/ios
Used in project
Icons:
Icons8 - https://icons8.com