gabrieltheodoropoulos / GTAlertCollection

GTAlertCollection: UIAlertController variations gathered in one place, introducing new simplified usage.
https://gtiapps.com/?p=4735
MIT License
16 stars 0 forks source link
activity-indicator alert automation collection destructive imageview ios progress-bar swift textfield uialertcontroller

GTAlertCollection

Platform Language License Version

About

GTAlertCollection is a Swift component that makes it possible to present alerts as easily as just calling a single method.

GTAlertCollection implements alert controllers based on the UIAlertController class. It supports and provides a variety of alert types:

GTAlertCollection Demo

Integrating GTAlertCollection into your project

There are two ways to integrate GTAlertCollection into your project.

Using CocoaPods

In your Podfile add the following:

pod 'GTAlertCollection'

Then import GTAlertCollection anywhere in your project where you want to use it.

import GTAlertCollection

Manually

Clone or download the repository, and add the GTAlertCollection.swift file from the GTAlertCollection/Source folder to your project.

At a glance

The following public methods are provided by GTAlertCollection:

presentSingleButtonAlert(withTitle:message:buttonTitle:actionHandler:)

presentAlert(withTitle:message:buttonTitles:cancelButtonIndex:destructiveButtonIndices:actionHandler:)

presentButtonlessAlert(withTitle:message:presentationCompletion:)

presentActivityAlert(withTitle:message:activityIndicatorColor:showLargeIndicator:presentationCompletion:)

presentProgressBarAlert(withTitle:message:progressTintColor:trackTintColor:showPercentage:showStepsCount:updateHandler:presentationCompletion:)

presentSingleTextFieldAlert(withTitle:message:doneButtonTitle:cancelButtonTitle:configurationHandler:completionHandler:)

presentMultipleTextFieldsAlert(withTitle:message:doneButtonTitle:cancelButtonTitle:numberOfTextFields:configurationHandler:completionHandler:)

presentImageViewAlert(withTitle:message:buttonTitles:cancelButtonIndex:destructiveButtonIndices:image:actionHandler:)
dismissAlert(completion:)

In addition, these properties are available as well:

Please read the wiki for details on how to use GTAlertCollection and the various alert types. You can also find exported documentation by jazzy.

Note

The implementation of the various alert controllers and the creation of the GTAlertCollection class is personal work and not a gathering of alerts found around on the web.