Squawk
Show important alerts from the bottom of the screen with full customization control.
Installation
Just add Squawk
to your Podfile and pod install. Done!
pod 'Squawk'
Usage
After installing Squawk
, you can start displaying alerts immediately:
import Squawk
func onError() {
Squawk.shared.show(config: Squawk.Configuration(
text: "Something went wrong!"
))
}
Use the view
param if you want to show the alert within a specific view.
func viewDidAppear() {
super.viewDidAppear()
Squawk.shared.show(
in: view,
config: Squawk.Configuration(
text: "Peek-a-boo"
)
)
}
Configuration
Squawk.Configuration
comes with loads of options:
text
- The text in the alerttextColor
- The color of the textπ backgroundColor
- Background color of the view (note: will be blurred)insets
- Inset the text and button within the alert viewmaxWidth
- The max width of the alert viewhintMargin
- Margin between the "hint" (top pill) and texthintSize
- The size of the hint pillcornerRadius
- Corner radius of the alert viewbottomPadding
- Extra padding to add to subtract from the finaly
of the alert viewborderColor
- Border color of the alert viewdismissDuration
- How long, in seconds, to wait before automatically dismissingbuttonVisible
- Set totrue
to show the "info" buttonbuttonLeftMargin
- The margin between the button and textbuttonTapHandler
- A closure to execute when the "info" button is tapped
Acknowledgements
- Created with
β€οΈ by Ryan Nystrom