语法糖
import UIKit
extension UIView: Constructible { }
var views = [UIView]()
views = 5 * UILabel.selfextension Int {
public static func *<T: Constructible>(count: Int, this: T.Type) -> [T] {
return (0..<count).map { _ in
return this.init()
}
}
}protocol Constructible {
init()
}