LCNotificationBanner is a lightweight macOS notification banner component!
- Using enumerations to define
LCNotificationBannerPosition
public enum LCNotificationBannerPosition {
case top
case bottom
case leftCenter
case rightCenter
}
![]() |
![]() |
---|---|
Success | Error |
![]() |
![]() |
---|---|
Info | Warning |
![]() |
![]() |
---|---|
Only Text | bottom |
![]() |
![]() |
---|---|
rightCenter | leftCenter |
- Background color
LCNotificationBanner.shared.bgColor = NSColor.systemBlue.cgColor
- Position
LCNotificationBanner.shared.position = .top
- Icon size
LCNotificationBanner.shared.iconSize = 20
- Title Font size
LCNotificationBanner.shared.titleFontSize = 14
- Success type
LCNotificationBanner.showSuccessWithStatus("This is a banner title", style: .dark, to: view.window)
- Error type
LCNotificationBanner.showErrorWithStatus("This is a banner title", style: .dark, to: view.window)
- Info type
LCNotificationBanner.showInfoWithStatus("This is a banner title", style: .dark, to: view.window)
- Warning type
LCNotificationBanner.showWarningWithStatus("This is a banner title", style: .dark, to: view.window)
- Text type only
LCNotificationBanner.showTextWithStatus("This is a banner title", to: view.window)
LCNotificationBanner is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LCNotificationBanner'
MIT License
Copyright (c) 2024 Marvin
DevLiuSir Software Engineer |
---|