Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension UIViewController{
- func drawHorizontalStrip(color : CGColor){
- let rect = CGRect(x: 0, y: 0, width: self.view.frame.width, height: 2)
- let lineStripView = UIView(frame: rect)
- lineStripView.layer.borderWidth = 1.0
- lineStripView.layer.borderColor = color
- self.view.addSubview(lineStripView)
- }
- }
- if (delegate.networkStatus != Reachability.NetworkStatus.notReachable)
- {
- drawHorizontalStrip(color: UIColor.green.cgColor)
- }
- else
- {
- drawHorizontalStrip(color: UIColor.red.cgColor)
- let nc = NotificationCenter.default
- nc.post(name:CONNECTIVITY_NOTIFICATION,
- object: nil,
- userInfo: ["message":"Connectivity Lost", "date":Date()])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement