@@ -45,6 +45,10 @@ public class LoadingViewController: UIViewController {
45
45
@IBOutlet public var contentView : UIView !
46
46
47
47
public var lastError : NSError ?
48
+ var defaultLoadingColor = UIColor ( colorLiteralRed: 250 / 255 , green: 250 / 255 , blue: 250 / 255 , alpha: 1 )
49
+ public var loadingViewColor : UIColor ?
50
+ public var noDataViewColor : UIColor ?
51
+ public var errorViewColor : UIColor ?
48
52
49
53
var visibleContentType : ContentType = . Undefined
50
54
var activeView : UIView ?
@@ -72,12 +76,14 @@ public class LoadingViewController: UIViewController {
72
76
73
77
func defaultNoDataView( ) -> UIView {
74
78
let view = NoDataView . viewWithStyle ( noDataViewStyle ( ) )
79
+ view. backgroundColor = noDataViewColor ?? loadingViewColor
75
80
view. message = noDataMessage
76
81
return view
77
82
}
78
83
79
84
func defaultErrorView( action: ActionHandler ? = nil ) -> UIView {
80
85
let view = ErrorView . viewWithStyle ( errorViewStyle ( ) , actionHandler: action)
86
+ view. backgroundColor = errorViewColor ?? loadingViewColor
81
87
view. title = errorTitle
82
88
view. message = errorMessage
83
89
view. image = errorIcon
@@ -86,6 +92,7 @@ public class LoadingViewController: UIViewController {
86
92
87
93
func defaultLoadingView( ) -> UIView {
88
94
let view = LoadingView . viewWithStyle ( loadingViewStyle ( ) )
95
+ view. backgroundColor = loadingViewColor ?? defaultLoadingColor
89
96
90
97
//TODO: add title, background image, etc.
91
98
view. title = " Loading "
0 commit comments