File tree Expand file tree Collapse file tree
Sources/FlexUI/Classes/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,4 +176,37 @@ public extension FlexUI where Component: UIView {
176176 component. setContentCompressionResistancePriority ( priority, for: axis)
177177 return self
178178 }
179+
180+ /// Adds a view to the end of the receiver’s list of subviews.
181+ ///
182+ /// - Parameter view: The view to be added. After being added, this view appears on top of any other subviews.
183+ /// - Returns: The current instance, allowing method chaining.
184+ @discardableResult
185+ @MainActor
186+ func addSubview( _ view: UIView ) -> Self {
187+ component. addSubview ( view)
188+ return self
189+ }
190+
191+ /// Adds an array of views to the end of the receiver’s list of subviews.
192+ ///
193+ /// - Parameter views: An array of views to be added.
194+ /// - Returns: The current instance, allowing method chaining.
195+ @discardableResult
196+ @MainActor
197+ func addSubviews( _ views: [ UIView ] ) -> Self {
198+ views. forEach { component. addSubview ( $0) }
199+ return self
200+ }
201+
202+ /// Adds multiple views as variadic parameters to the end of the receiver’s list of subviews.
203+ ///
204+ /// - Parameter views: A variable number of views to be added.
205+ /// - Returns: The current instance, allowing method chaining.
206+ @discardableResult
207+ @MainActor
208+ func addSubviews( _ views: UIView ... ) -> Self {
209+ views. forEach { component. addSubview ( $0) }
210+ return self
211+ }
179212}
You can’t perform that action at this time.
0 commit comments