
TAG: BPStatusBarAlert , CFNotify , Swift , Custom Notification , Alert , Alert view , custom view popup ,Custom Toast , ios , Notification
Licence: MIT
Classification: BPStatusBarAlert
Platform: IOS
Language: Swift
Language: Swift
Device:
iPhone / iPad
CocoaPods
BPStatusBarAlert is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BPStatusBarAlert"
pod "BPStatusBarAlert"
Manual
Copy the folder BPStatusBarAlert to your project
BPStatusBarAlert to your projectUsage
First, you need the following import BPStatusBarAlert
import BPStatusBarAlert
Now, you can uses BPStatusBarAlert simply like this
@IBAction func buttonTapped(_ sender: Any) {
BPStatusBarAlert()
.message(message: "Complete Sharing This Contents")
.show()
}
Initialize BPStatusBarAlert with no parameters, it will set up default value for property Default setting
- Animation Duration : 0.3
- Animation Delay : 2.0
- Postion : .statusBar
- Background Color : UIColor(red: 77/255, green: 188/255, blue: 201/255, alpha: 1)
- Message Text : ""
- Message Text Color : .white
- Completion : nil
So, If you want customize property, just call init method with parameters and chaning function
- init (customize Duration, Delay and Postion)
BPStatusBarAlert class init method is composed below code
public init(duration: TimeInterval = 0.3, delay: TimeInterval = 2, position: AlertPosition = .statusBar)
So, if you change time interval in animations and position of BPStatusBarAlert, using defaults paramaters
- chaning function (customize Background Color, Message Text, Message Text Color, Completion)
BPStatusBarAlert(duration: 0.3, delay: 2, position: .statusBar) // customize duration, delay and position
.message(message: "Complete Sharing This Contents") // customize message
.messageColor(color: .white) // customize message color
.bgColor(color: .blue) // customize view's background color
.completion { print("completion closure will called") } // customize completion(Did hide alert view)
.show() // Animation start
BPStatusBarAlertimport BPStatusBarAlert
BPStatusBarAlert simply like this@IBAction func buttonTapped(_ sender: Any) {
BPStatusBarAlert()
.message(message: "Complete Sharing This Contents")
.show()
}
BPStatusBarAlert with no parameters, it will set up default value for property Default settingBPStatusBarAlert class init method is composed below codepublic init(duration: TimeInterval = 0.3, delay: TimeInterval = 2, position: AlertPosition = .statusBar)
BPStatusBarAlert, using defaults paramatersBPStatusBarAlert(duration: 0.3, delay: 2, position: .statusBar) // customize duration, delay and position
.message(message: "Complete Sharing This Contents") // customize message
.messageColor(color: .white) // customize message color
.bgColor(color: .blue) // customize view's background color
.completion { print("completion closure will called") } // customize completion(Did hide alert view)
.show() // Animation start
