iDonateAlert iOS SDK to show donation alerts easily in your app.
- iOS 11.0+
- Xcode 14+
- Swift 5.7+
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
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)
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)
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)
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)
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.
Thanks goes to these wonderful people (emoji meanings):
Rashid Ramazanov 💻 📖 🚇 🧑🏫 |
Eser Kucuker 💻 📖 |
Furkan Erucar 💻 |
Samet Ögütcüoğlu 💻 |
bariscan-mobven 🖋 📋 🤔 🌍 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Developed with 🖤 at Mobven