Skip to content

Instantly share code, notes, and snippets.

@hmchen
hmchen / README.md
Created December 9, 2023 04:58 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
class BufferingStackView: UIStackView {
private var viewBuffer: ViewBuffer = ViewBuffer()
func prepare<T: UIView>(viewCount: Int, config: @escaping (_ index: Int, _ view: T) -> Void) {
let currentViewCount = self.arrangedSubviews.count
let neededViewCount = viewCount
let diff = neededViewCount - currentViewCount
let absDiff = abs(diff)
let shouldDelete = diff < 0
if shouldDelete {
(0..<absDiff).forEach({ _ in