https://github.com/gabrieltheodoropoulos/gtalertcollection
GTAlertCollection: UIAlertController variations gathered in one place, introducing new simplified usage.
https://github.com/gabrieltheodoropoulos/gtalertcollection
activity-indicator alert automation collection destructive imageview ios progress-bar swift textfield uialertcontroller
Last synced: 6 months ago
JSON representation
GTAlertCollection: UIAlertController variations gathered in one place, introducing new simplified usage.
- Host: GitHub
- URL: https://github.com/gabrieltheodoropoulos/gtalertcollection
- Owner: gabrieltheodoropoulos
- License: mit
- Created: 2018-10-25T08:41:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-17T16:12:42.000Z (about 6 years ago)
- Last Synced: 2024-11-18T03:57:53.405Z (6 months ago)
- Topics: activity-indicator, alert, automation, collection, destructive, imageview, ios, progress-bar, swift, textfield, uialertcontroller
- Language: Swift
- Homepage: https://gtiapps.com/?p=4735
- Size: 117 KB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GTAlertCollection



## 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:

## Integrating GTAlertCollection into your project
There are two ways to integrate GTAlertCollection into your project.
### Using CocoaPods
In your Podfile add the following:
```ruby
pod 'GTAlertCollection'
```Then import `GTAlertCollection` anywhere in your project where you want to use it.
```swift
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`:
```swift
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:
* `alertController`: The presented alert controller.
* `hostViewController`: The view controller that the alert controller is presented to.
* `activityIndicator`: The activity indicator of the alert.
* `progressBar`: The `UIProgressView` object that displays the progress bar.
* `label`: The label right below the progress bar.
* `imageView`: The image view of the alert.Please read the [wiki](https://github.com/gabrieltheodoropoulos/GTAlertCollection/wiki) for details on how to use `GTAlertCollection` and the various alert types. You can also find [exported documentation](https://gtiapps.com/docs/gtalertcollection) by [jazzy](https://github.com/realm/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.