From 7640752aabe0d33d3980071e5ac76d0470b41dce Mon Sep 17 00:00:00 2001 From: dutcher Date: Fri, 2 Dec 2016 08:32:15 -0500 Subject: [PATCH] Added UIStackView convenience addArrangedSubviews --- Example/Podfile.lock | 6 +++--- Pod/Classes/LayoutConvenience.swift | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 5cfee13..ab7eb31 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,15 +1,15 @@ PODS: - - URBNConvenience (2.0.5) + - URBNConvenience (2.1.2) DEPENDENCIES: - URBNConvenience (from `../`) EXTERNAL SOURCES: URBNConvenience: - :path: "../" + :path: ../ SPEC CHECKSUMS: - URBNConvenience: ae4e190a12091c998061d87bd7b8796ea2ef27f8 + URBNConvenience: 1da2817340e61c499d58bd89d4c5e46dbfef628a PODFILE CHECKSUM: 4bfbebbb9fc7a9a90efd38463f9ff637cb17d94e diff --git a/Pod/Classes/LayoutConvenience.swift b/Pod/Classes/LayoutConvenience.swift index b1d3517..10bc8eb 100644 --- a/Pod/Classes/LayoutConvenience.swift +++ b/Pod/Classes/LayoutConvenience.swift @@ -57,3 +57,17 @@ public extension UIView { return container } } + +@available(iOS 9.0, *) +public extension UIStackView { + + public func addArrangedSubviews(_ subviews: UIView...) { + addArrangedSubviews(subviews) + } + + public func addArrangedSubviews(_ subviews: [UIView]) { + for v in subviews { + addArrangedSubview(v) + } + } +}