@@ -37,29 +37,35 @@ extension StatusViewError: LocalizedError {
3737
3838@objc public class StatusView : UIView {
3939
40+ /// Appearance proxy property for setting the title label text color
4041 @objc public dynamic var titleLabelTextColor : UIColor ? {
4142 get { return self . titleLabel. textColor }
4243 set { self . titleLabel. textColor = newValue }
4344 }
4445
46+ /// Appearance proxy property for setting the title label font
4547 @objc public dynamic var titleLabelFont : UIFont ? {
4648 get { return self . titleLabel. font }
4749 set { self . titleLabel. font = newValue }
4850 }
4951
52+ /// Appearance proxy property for setting the message label text color
5053 @objc public dynamic var messageLabelTextColor : UIColor ? {
5154 get { return self . messageLabel. textColor }
5255 set { self . messageLabel. textColor = newValue }
5356 }
5457
58+ /// Appearance proxy property for setting the message label font
5559 @objc public dynamic var messageLabelFont : UIFont ? {
5660 get { return self . messageLabel. font }
5761 set { self . messageLabel. font = newValue }
5862 }
5963
6064
61- private( set) var state = StatusViewState . hidden
65+ /// State of the StatusView
66+ public private( set) var state = StatusViewState . hidden
6267
68+ /// The loading view, which is shown when state is `.loading`
6369 public var loadingView : UIView ? {
6470 didSet {
6571 guard let loadingView = self . loadingView else {
@@ -80,12 +86,20 @@ extension StatusViewError: LocalizedError {
8086 }
8187 }
8288
83- public var button = UIButton ( )
84- public var titleLabel = UILabel ( )
85- public var messageLabel = UILabel ( )
86- public var statusImageView = UIImageView ( )
89+ public let button = UIButton ( )
90+ public let titleLabel = UILabel ( )
91+ public let messageLabel = UILabel ( )
92+ public let statusImageView = UIImageView ( )
93+
8794 private var initial = true
8895
96+ /// Create
97+ /// Use this to setup the StatusView
98+ ///
99+ /// - Parameters:
100+ /// - loadingView: pass the loading view to be shown during loading state
101+ /// - view: parent view to be added to
102+ /// - Returns: a configured StatusView
89103 public static func create( with loadingView: UIView ? = nil , addTo view: UIView ) -> StatusView {
90104 let statusView = StatusView ( )
91105 view. addSubview ( statusView)
@@ -231,22 +245,17 @@ extension StatusViewError: LocalizedError {
231245
232246 var layoutConstraints = [ NSLayoutConstraint] ( )
233247
234- /// The current state of the status view
235- var currentState : StatusViewState {
236- return self . state
237- }
238-
239248 /// Show or hide status view with the following paramaters, animates where appropriate
240249 /// If any paramater is unset, that component will not show
241250 /// Before use view will need to be added to a superview and layout constraints set
242251 ///
243252 /// - Parameters:
244253 /// - state: to be set to
245- /// - title: label text
246- /// - message: label text
254+ /// - title: text to be set as predominant text
255+ /// - message: text to be set as the more detailed text
247256 /// - statusImage: image shown at the top of view
248- /// - buttonImage: image shown in button
249- /// - animate: animate the transition
257+ /// - buttonImage: image shown in button, also enabling the button
258+ /// - animate: true to animate the transition between states
250259 public func changeTo( state: StatusViewState , title: String ? = nil , message: String ? = nil , statusImage: UIImage ? = nil , buttonImage: UIImage ? = nil , animate: Bool = true ) throws {
251260
252261 guard let loadingView = self . loadingView else {
0 commit comments