Skip to content

Together, we can make a difference in the lives of those affected by natural disasters and help build a better tomorrow.

License

Notifications You must be signed in to change notification settings

mobven/iDonateAlert

Repository files navigation

iDonateAlert

All Contributors

iDonateAlert iOS SDK to show donation alerts easily in your app.

Examples

UI UI

Requirements

  • iOS 11.0+
  • Xcode 14+
  • Swift 5.7+

Installation

iDonateAlert is distributed with Swift Package Manager. You can add framework to your project from Xcode's File > Swift Packages > Add Package Dependency menu with its github URL:

https://github.com/mobven/iDonateAlert.git

Usage

Default initializer

iDonateAlert can be initialized through, which has default title and message those are presented in the screenshot above.

let alert = iDonateAlert()
alert.present(over: self)

Custom title, message and icon

If you want to use custom title and message, you can use below initializer. You can pass icon to use custom icon.

let alert = iDonateAlert(title: "Donate", message: "Donation lorem impsum...")
alert.present(over: self)

Attributed title and message, and custom icon

You can use .init(attributedTitle:, attributedMessage:) to use attributed parameters for title and messages including your own fonts.

let attributedTitle = NSAttributedString(string: "Donate")
let attributedMessage = NSAttributedString(string: "Donation lorem impsum...")
let alert = iDonateAlert(attributedTitle: attributedTitle, attributedMessage: attributedMessage)
alert.present(over: self)

Custom Action Buttons

By default it has, AHBAP, AFAD and Turk Kizilayi buttons. If you want to add custom buttons, you can set it via:

let alert = iDonateAlert()
alert.removeAllActions()
alert.addAction(
    .init(
        title: "INDIVIDUAL DONATION", image: nil,
        borderColor: UIColor.systemPink, backgroundColor: UIColor.white,
        url: URL(string: "https://www.afad.gov.tr/depremkampanyasi2")!
    )
)
alert.present(over: self)

Localization

You can pass iDonateAlertLocale value to it's initializer to set locale.

let alert = iDonateAlert(locale: .en)

Currently, English and Turkish languages are supported. Please feel free to contribute to add other languages.

Contributors ✨

Thanks goes to these wonderful people (emoji meanings):

Rashid Ramazanov
Rashid Ramazanov

💻 📖 🚇 🧑‍🏫
Eser Kucuker
Eser Kucuker

💻 📖
Furkan Erucar
Furkan Erucar

💻
Samet Ögütcüoğlu
Samet Ögütcüoğlu

💻
bariscan-mobven
bariscan-mobven

🖋 📋 🤔 🌍

This project follows the all-contributors specification. Contributions of any kind welcome!


Developed with 🖤 at Mobven

About

Together, we can make a difference in the lives of those affected by natural disasters and help build a better tomorrow.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages