Customizable native-like sheet alert controller with three action types: separately, inner, none.
Interaction with SheetViewController
that have .inner
action type:
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .separately)
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .inner)
let alert = SheetViewController.alert(with: <title>, message: <message>, actionType: .none)
To run the example project, clone the repo, and run pod install
from the Example directory first.
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
// '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)
Anton Yereshchenko
SheetViewController is available under the MIT license. See the LICENSE file for more info.
Designing for iPhone in Figma - https://setproduct.com/ios
Icons:
Icons8 - https://icons8.com