@@ -31,7 +31,7 @@ protocol CellPlaceholding {
3131 /// Sets in the cell the placeholder texts, image, ...
3232 ///
3333 /// - Parameter data: the data of the cell (texts, images, etc)
34- func apply( data: PlaceholderData )
34+ func apply( data: PlaceholderData ? )
3535}
3636
3737
@@ -45,38 +45,35 @@ extension CellPlaceholding {
4545 /// - style: the style to apply
4646 /// - tintColor: the tint color, is used for some items when the style color is nil
4747 internal func apply( style: PlaceholderStyle , tintColor: UIColor ? ) {
48- cellView. backgroundColor = style. backgroundColor ?? . clear
48+ cellView. backgroundColor = style. backgroundColor
4949
5050 let buttonBackgroundColor = style. actionBackgroundColor ?? tintColor
5151 actionButton? . backgroundColor = buttonBackgroundColor
5252
53- let actionColor = style. actionTitleColor ?? . white
53+ let actionColor = style. actionTitleColor
5454 actionButton? . setTitleColor ( actionColor, for: . normal)
55+ actionButton? . titleLabel? . font = style. actionTitleFont
5556
56- activityIndicator? . color = style. activityIndicatorColor ?? . lightGray
57-
58- titleLabel? . textColor = style. titleColor ?? . darkText
59- subtitleLabel? . textColor = style. subtitleColor ?? . gray
57+ activityIndicator? . color = style. activityIndicatorColor
6058
59+ titleLabel? . textColor = style. titleColor
60+ titleLabel? . font = style. titleFont
6161
62+ subtitleLabel? . textColor = style. subtitleColor
63+ subtitleLabel? . font = style. subtitleFont
6264 }
6365
6466 /// Sets in the cell the placeholder texts, image, ...
6567 ///
6668 /// - Parameter data: the data of the cell (texts, images, etc)
67- internal func apply( data: PlaceholderData ) {
68- actionButton? . setTitle ( data. action, for: . normal)
69- actionButton? . isHidden = ( data. action == nil )
70-
71- titleLabel? . text = data. title
72- titleLabel? . isHidden = ( data. title == nil )
73-
74- subtitleLabel? . text = data. subtitle
75- subtitleLabel? . isHidden = ( data. title == nil )
69+ internal func apply( data: PlaceholderData ? ) {
70+ actionButton? . setTitle ( data? . action, for: . normal)
71+ actionButton? . isHidden = ( data? . action == nil )
7672
77- placeholderImageView? . image = data. image
78- placeholderImageView? . isHidden = ( data. image == nil )
73+ titleLabel? . text = data? . title
74+ subtitleLabel? . text = data? . subtitle
75+ placeholderImageView? . image = data? . image
7976
80- data. showsLoading == true ? activityIndicator? . startAnimating ( ) : activityIndicator? . stopAnimating ( )
77+ data? . showsLoading == true ? activityIndicator? . startAnimating ( ) : activityIndicator? . stopAnimating ( )
8178 }
8279}
0 commit comments