Add documentation for AnyLoadingIndicator

This commit is contained in:
Ivan Smolin 2017-04-11 13:34:00 +03:00
parent b3dface0c8
commit f0d4fd9505
1 changed files with 5 additions and 0 deletions

View File

@ -22,16 +22,21 @@
import UIKit
/// Type that performs some kind of type erasure for LoadingIndicator.
public struct AnyLoadingIndicator: Animatable {
private let internalView: UIView
private let animatableView: Animatable
/// Initializer with indicator that should be wrapped.
///
/// - Parameter _: indicator for wrapping.
public init<Indicator>(_ base: Indicator) where Indicator: LoadingIndicator {
self.internalView = base.view
self.animatableView = base.view
}
/// The indicator view.
var view: UIView {
return internalView
}