variadic arguments

Here’s the code if you want to experiment with it!

import UIKit

extension UIView {
    func add(subviews: UIView...) {
        for subview in subviews {
            self.addSubview(subview)
        }
    }
}

view.add(subviews: firstView, secondView, thirdView)
Previous
Previous

if-else vs switch

Next
Next

CaseIterable