Latest 0.1.3
Homepage https://github.com/AlphaDog13/RXEmptyBg
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit

参考:TBEmptyDataSet

内容

样例

RXEmptyBg

需要

  • iOS 8.0+
  • Xcode 9.0+
  • Swift 3.0+

使用

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'RXEmptyBg', '~> 0.1.0'
end

开始

初始化

extension ViewController: EmptyBgDataSource, EmptyBgDelegate

lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style: .plain)
tableView.translatesAutoresizingMaskIntoConstraints = false
tableView.dataSource = self
tableView.delegate = self
tableView.emptyBgDelegate = self
tableView.emptyBgDataSource = self
return tableView
}()

EmptyBgDataSource

func imgForEmptyBg(in scrollView: UIScrollView) -> UIImage?                //背景图片
func titleForEmptyBg(in scrollView: UIScrollView) -> NSAttributedString?   //背景标题
func detailForEmptyBg(in scrollView: UIScrollView) -> NSAttributedString?  //背景详情

EmptyBgDelegate

func emptyBgShouldDisplay(in scrollView: UIScrollView) -> Bool  //是否显示背景
func emptyBgShouldTap(in scrollView: UIScrollView) -> Bool      //背景是否可点击

func emptyBgTapAction(in scrollView: UIScrollView)              //背景点击事件

func emptyBgWillDisplay(in scrollView: UIScrollView)            //背景将显示
func emptyBgDidDisplay(in scrollView: UIScrollView)             //背景已显示

License

纯粹开源

Latest podspec

{
    "name": "RXEmptyBg",
    "version": "0.1.3",
    "summary": "An notice view for empty scrollView and its's subClass",
    "homepage": "https://github.com/AlphaDog13/RXEmptyBg",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "AlphaDog13",
    "source": {
        "git": "https://github.com/AlphaDog13/RXEmptyBg.git",
        "tag": "0.1.3"
    },
    "source_files": "RXEmptyBg/*.swift",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This