Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparrowcode/AlertKit
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
https://github.com/sparrowcode/AlertKit
alert alert-controller animated apple apple-music applemusic appstore feedback ios native popup swift swiftui swiftui-example ui ui-components uikit
Last synced: 15 days ago
JSON representation
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
- Host: GitHub
- URL: https://github.com/sparrowcode/AlertKit
- Owner: sparrowcode
- License: mit
- Created: 2019-04-28T13:03:40.000Z (over 5 years ago)
- Default Branch: v5
- Last Pushed: 2024-08-11T16:29:07.000Z (4 months ago)
- Last Synced: 2024-10-29T15:34:10.250Z (about 2 months ago)
- Topics: alert, alert-controller, animated, apple, apple-music, applemusic, appstore, feedback, ios, native, popup, swift, swiftui, swiftui-example, ui, ui-components, uikit
- Language: Swift
- Homepage: https://sparrowcode.io/frameworks
- Size: 10.6 MB
- Stars: 2,401
- Watchers: 16
- Forks: 134
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ios - SPAlert - Native popup from Apple Music & Feedback in AppStore. Contains Done & Heart presets. (UI / Alert & Action Sheet)
README
# AlertKit
**Popup from Apple Music & Feedback in AppStore**. Contains `Done`, `Heart`, `Error` and other. Supports Dark Mode.
I tried to recreate Apple's alerts as much as possible. You can find these alerts in the AppStore after feedback and after you add a song to your library in Apple Music.![Alert Kit v5](https://cdn.sparrowcode.io/github/alertkit/v5/preview-v1_2.png)
For UIKit & SwiftUI call this:
```swift
AlertKitAPI.present(
title: "Added to Library",
icon: .done,
style: .iOS17AppleMusic,
haptic: .success
)
```Available 2 styles:
```swift
public enum AlertViewStyle {case iOS16AppleMusic
case iOS17AppleMusic
}
```### iOS Dev Community
## Navigate
- [Installation](#installation)
- [Swift Package Manager](#swift-package-manager)
- [CocoaPods](#cocoapods)
- [SwiftUI](#swiftui)
- [Present & Dismiss](#present--dismiss)
- [Customisation](#customisation)
- [Apps Using](#apps-using)## Installation
Ready to use on iOS 13+. Supports iOS and visionOS. Working with `UIKit` and `SwiftUI`.
### Swift Package Manager
In Xcode go to Project -> Your Project Name -> `Package Dependencies` -> Tap _Plus_. Insert url:
```
https://github.com/sparrowcode/AlertKit
```or adding it to the `dependencies` of your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/sparrowcode/AlertKit", .upToNextMajor(from: "5.1.8"))
]
```### CocoaPods:
This is an outdated way of doing things. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time.
Cocoapods Installation
[CocoaPods](https://cocoapods.org) is a dependency manager. For usage and installation instructions, visit their website. To integrate using CocoaPods, specify it in your `Podfile`:
```ruby
pod 'SPAlert'
```### Manually
If you prefer not to use any of dependency managers, you can integrate manually. Put `Sources/AlertKit` folder in your Xcode project. Make sure to enable `Copy items if needed` and `Create groups`.
## SwiftUI
You can use basic way via `AlertKitAPI` or call via modifier:
```swift
let alertView = AlertAppleMusic17View(title: "Hello", subtitle: nil, icon: .done)VStack {}
.alert(isPresent: $alertPresented, view: alertView)
```## Customisation
If you need customisation fonts, icon, colors or any other, make view:
```swift
let alertView = AlertAppleMusic17View(title: "Added to Library", subtitle: nil, icon: .done)// change font
alertView.titleLabel.font = UIFont.systemFont(ofSize: 21)
// change color
alertView.titleLabel.textColor = .white
```## Present & Dismiss
You can present and dismiss alerts manually via view.
```swift
let alertView = AlertAppleMusic17View(title: "Added to Library", subtitle: nil, icon: .done)// present
alertView.present(on: self)
// and dismiss
alertView.dismiss()
```For dismiss all alerts that was presented:
```swift
AlertKitAPI.dismissAllAlerts()
```## Apps Using
If you use a `AlertKit`, add your app via Pull Request.