WeakNetManagerSwift - 无数据无网络的提示模

2018-09-18  本文已影响50人  ShayneFcf

WeakNetManagerSwift

封装的一套无数据或者无网络的提示模板
使用:
默认样式:

// 默认样式 只有无数据图片和文字提示
        showPlaceHold() 
image

1、定制按钮

//      两个按钮 无数据
        let item = FCFPlaceHolderBtnItem(title: "刷新") { (btn) in
            print("xxxxx")
        }
        item.layer.cornerRadius = 22
        item.layer.masksToBounds = true
        item.btn.setTitleColor(UIColor.white, for: .normal)
        item.backgroundColor = UIColor.hexString(hex: "0x00a0ea")
        
        let item1 = FCFPlaceHolderBtnItem(title: "确定") { (btn) in
            print("xxxxx")
        }
        item1.layer.cornerRadius = 22
        item1.layer.masksToBounds = true
        item1.btn.setTitleColor(UIColor.white, for: .normal)
        item1.backgroundColor = UIColor.hexString(hex: "0x00a0ea")
        

        let frame = CGRect(x:0, y:0, width: 300, height: 250)
        let hintView = FCFPlaceHolderContentView(frame: frame, hasImg: true, hasPlaceLabel: true,hasBtn:true,placeBtns:[item,item1])
        hintView.center = self.view.center
        view.addSubview(hintView)
image

2、cell蒙版样式,类似简书:

//cell 蒙版
        let hintView = FCFPlaceHolderContentView(frame: self.view.bounds, gradLayer:true)
        hintView.center = self.view.center
        view.addSubview(hintView)

image

3、监听到的无网络状态

image
image

可以去github上查看Demo
github
CSDN

上一篇下一篇

猜你喜欢

热点阅读