Closed PedroCavaleiro closed 3 years ago
Thanks for changes! You solve many problems. I soon check it. Thanks!
It's now possible to change the foreground color and made a small change on the initialization of the activity view
let alertWithDismiss = SPAlertView(loadingMessage: "Loading...")
let alertWithTimeout = SPAlertView(loadingMessage: "Loading...", timeout: 3)
alertWithDismiss.foregroundColor = UIColor.white
If no color is passed it uses the default check the private var foregroundColorDefault: UIColor
It's now possible to add a blur to the views under the alert.
By default the blur is disabled for the alerts and enabled for the loading views
let alert = SPAlertView(loadingMessage: "Loading...")
alert.blurBackground = false
In case of the loading views you can disable on the initialization
let alert = SPAlertView(loadingMessage: "Loading...", blurBackground: false)
Looks very nice! waiting on this as well asap!
As I'm also using this for an app that supports macOS Catalyst, this would give me a warning, to suppress the warning I added the following code.
public var keyWindow: UIView {
if #available(iOS 13, macCatalyst 13, *) {
return UIApplication.shared.connectedScenes
.filter({$0.activationState == .foregroundActive})
.map({$0 as? UIWindowScene})
.compactMap({$0})
.first?.windows
.filter({$0.isKeyWindow}).first ?? UIWindow()
} else {
return (UIApplication.shared.keyWindow ?? UIWindow())
}
}
Allowing the newest versions of iOS, and macCatalyst to work but also older versions will still work
Hi! Sorry for big delay. I am open talk about loading if its still need.
Hi,
I suggested a Loading View a few months back and you pointed me to this repo mlouli/SPAlert
I grabbed his changes but also made a few of my own
you can show a alert in a simple yet fast way
If you want using the timeout it's also possible
by default it makes the loading view as a rectangle, this is a preference of my own, but you may disable this option by
this way it will use the normal calculations.
I also updated the README.md to include this changes.
This library was tested in SwiftUI and found no errors