杨锴
2025-05-11 7453d2d0cef415b34323d1b91e6cfa4a6ba31178
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
//  BaseTableView.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/7/7.
//
 
import UIKit
import EmptyDataSet_Swift
import JQTools
 
class BaseTableView:UITableView{
    public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_LOGO")?.jq_imageWithTintColor(color: .gray),foregroundColor:UIColor = UIColor.gray,clouse:((EmptyDataSetView)->Void)? = nil) {
        self.separatorStyle = .none
        self.emptyDataSetView { (emptyDataSetView) in
            emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 18,weight: .medium), .foregroundColor:foregroundColor as Any]))
                .image(image)
                .dataSetBackgroundColor(UIColor.white)
                .verticalOffset(0)
                .verticalSpace(15)
                .shouldDisplay(true)
                .shouldFadeIn(true)
                .isTouchAllowed(true)
                .isScrollAllowed(true)
                .didTapContentView {
 
                }
            clouse?(emptyDataSetView)
        }
    }
}
 
class BaseCollectionView:UICollectionView{
    public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_LOGO")?.jq_imageWithTintColor(color: .gray),foregroundColor:UIColor = UIColor.gray,clouse:((EmptyDataSetView)->Void)? = nil) {
        self.emptyDataSetView { (emptyDataSetView) in
            emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 18,weight: .medium), .foregroundColor:foregroundColor as Any]))
                .image(image)
                .dataSetBackgroundColor(UIColor.white)
                .verticalOffset(0)
                .verticalSpace(15)
                .shouldDisplay(true)
                .shouldFadeIn(true)
                .isTouchAllowed(true)
                .isScrollAllowed(true)
                .didTapContentView {
 
                }
            clouse?(emptyDataSetView)
        }
    }
}