Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Sources/FlexUI/Classes/Extensions/FlexUI+UICollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,15 @@ public extension FlexUI where Component: UICollectionView {
component.isPagingEnabled = isPagingEnabled
return self
}

/// Sets the refresh control associated with the scroll view.
///
/// - Parameter refreshControl: The refresh control associated with the scroll view.
/// - Returns: The current instance of `FlexUI` for further configuration.
@discardableResult
@MainActor
func refreshControl(_ refreshControl: UIRefreshControl) -> Self {
component.refreshControl = refreshControl
return self
}
}
33 changes: 33 additions & 0 deletions Sources/FlexUI/Classes/Extensions/FlexUI+UITableView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// flex-ui
// Copyright © 2026 Space Code. All rights reserved.
//

import UIKit

/// An extension to `FlexUI` that adds helper methods for configuring `UITableView` properties.
/// These methods allow for fluent configuration of properties such as scroll indicators, selection,
/// and registration of cells and headers.
public extension FlexUI where Component: UITableView {
/// Sets the delegate for the table view.
///
/// - Parameter delegate: The delegate object that conforms to `UITableViewDelegate`.
/// - Returns: The current instance of `FlexUI` for further configuration.
@discardableResult
@MainActor
func delegate(_ delegate: UITableViewDelegate?) -> Self {
component.delegate = delegate
return self
}

/// Sets the data source for the table view.
///
/// - Parameter dataSource: The data source object that conforms to `UITableViewDataSource`.
/// - Returns: The current instance of `FlexUI` for further configuration.
@discardableResult
@MainActor
func dataSource(_ dataSource: UITableViewDataSource?) -> Self {
component.dataSource = dataSource
return self
}
}
Loading