You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to give you a heads up that the Alert component used in your package is deprecated in the latest version of SwiftUI. I've created a custom alert as a temporary solution, but it would be awesome if you could update the package to support the current SwiftUI version.
Thanks for creating this package - it's been super helpful for my app, and I really appreciate your work. Looking forward to seeing the update!
Cheers!
// CustomAlert.swift
import SwiftUI
publicclassCustomAlert:ObservableObject{lettitle:Textletmessage:AnyViewletcontent:AnyViewpublicinit(title:Text, message:someView, content:someView){self.title = title
self.message =AnyView(message)self.content =AnyView(content)}publicinit(title:Text, message:someView){self.title = title
self.message =AnyView(message)self.content =AnyView(Button("OK"){})}}
// View+CustomAlert.swift
import SwiftUI
publicextensionView{
/**
Present an alert from a certain context. The alert will
be presented when the context is active.
*/
func customAlert(context:CustomAlertContext)->someView{alert(context.alertObject?.title ??Text(""), isPresented: context.isActiveBinding){
context.alertObject?.content
} message:{
context.alertObject?.message ??AnyView(Text(""))}}}
The text was updated successfully, but these errors were encountered:
https://developer.apple.com/documentation/swiftui/alert
I just wanted to give you a heads up that the Alert component used in your package is deprecated in the latest version of SwiftUI. I've created a custom alert as a temporary solution, but it would be awesome if you could update the package to support the current SwiftUI version.
Thanks for creating this package - it's been super helpful for my app, and I really appreciate your work. Looking forward to seeing the update!
Cheers!
The text was updated successfully, but these errors were encountered: