A Swift package that mimics the UIAlertController Actionsheet with added features.
ActionSheetController gives you the ability to add extra features like custom views, images, custom view actions and headers to your UIAlertController not originally available out of the box.
Platforms supported:
iOS 13+
Adding to your project
Follow Apple’s guidance
to add the package to your project through SPM.
Usage
Basic usage
Basic ActionSheetController. Directly mimics the UIAlertController Actionsheet
import ActionSheetController
let alert = ActionSheetController(title: "Backup Data", message: "How often do you want to backup your data?")
alert.addAction(title: "Daily", type: .normal, action: {
// Backup Daily
})
alert.addAction(title: "Weekly", type: .normal, action: {
// Backup Weekly
})
alert.addAction(title: "Monthly", type: .normal, action: {
// Backup Monthly
})
alert.addAction(title: "Never", type: .destructive, action: nil)
alert.launch()
ActionSheetController with done action
ActionSheetController with addAction . Replaces the Cancel text with a custom title and an action to be performed if needed
let alert = ActionSheetController(title: "Log Session", message: "Do you want to continue logging your session?")
alert.addAction(title: "Yes", type: .normal, action: nil)
alert.addAction(title: "No", type: .normal, action: nil)
alert.addDoneAction(title: "Ask me later", type: .normal) {
//Perform Action
}
alert.launch()
ActionSheetController with header view
ActionSheetController with addHeader(view: UIView) . Adds a custom header to the ActionSheetController
ActionSheetController
A Swift package that mimics the
UIAlertController Actionsheet
with added features.ActionSheetController gives you the ability to add extra features like custom views, images, custom view actions and headers to your UIAlertController not originally available out of the box.
Platforms supported:
Adding to your project
Follow Apple’s guidance to add the package to your project through SPM.
Usage
Basic usage
Basic
ActionSheetController
. Directly mimics theUIAlertController Actionsheet
ActionSheetController with done action
ActionSheetController
withaddAction
. Replaces the Cancel text with a custom title and an action to be performed if neededActionSheetController with header view
ActionSheetController
withaddHeader(view: UIView)
. Adds a custom header to the ActionSheetControllerActionSheetController with customAction view
ActionSheetController
withaddCustomAction(view: UIView)
. Adds a custom action view to the ActionSheetControllerActionSheetController with header image
ActionSheetController
withaddHeader(image: UIImage?, size: Size? = nil, cornerRadius: CGFloat? = nil, title: String?, message: String?)
. Adds a custom header image to the ActionSheetController