 
 /// Data structure that wraps an array of items to represent a tableView/collectionView section.
 public struct Section {
-    /// The header data for this section
+    /// Title text for this section
+    public var title: String?
+
+    /// The header reusable for this section
     public var header: Reusable?
-
+    
     /// The item data for this section
     public var items: [Item]
 


extension DataSource: UIScrollViewDelegate {
    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
        if let onScroll = onScroll {
            onScroll(scrollView)
        }
    }

/// You must specify the View class that a Reusable will represent in the `configure` closure.
/// View must be a subtype of UITableViewCell, UITableViewHeaderFooterView, UICollectionViewCell, UICollectionReusableView
public class Reusable {
    public let viewClass: UIView.Type
    private let _reuseIdentifier: String?
    
    public let configure: ConfigureBlock
    
    public var reuseIdentifier: String {
        if let customReuseIdentifier = _reuseIdentifier {
            return customReuseIdentifier
        } else {
            return String(describing: viewClass)
        }
    }

    public init<View: UIView>(
        reuseIdentifier: String? = nil,
        configure: @escaping (View) -> Void
    ) {
        self.configure = { view in
            configure(view as! View)
        }
        self.viewClass = View.self
        self._reuseIdentifier = reuseIdentifier
    }
}


// MARK: - Item

/// Object used to configure a UITableViewCell or UICollectionViewCell
public class Item: Reusable {
    
    public struct Options {
        let reorderable: Bool
        let reuseIdentifier: String?
        
        static var `default`: Options {
            return Options(
                reorderable: false,
                reuseIdentifier: nil
            )
        }
    }
    
    public let onSelect: IndexPathBlock?
    public let onDelete: IndexPathBlock?
    public let options: Options

    /**
     Initialize an item

     - parameters:
     - configure: The configuration block.
     - onSelect: The closure to execute when the item is tapped
     - onDelete: The closure to execute when the item is deleted
     - options: Additional configuration parameters
     */
    public init<T: UIView>(
        configure: @escaping (T) -> Void,
        onSelect: IndexPathBlock? = nil,
        onDelete: IndexPathBlock? = nil,
        options: Options = .default
    ) {
        self.onSelect = onSelect
        self.onDelete = onDelete
        self.options = options
        super.init(reuseIdentifier: options.reuseIdentifier, configure: configure)
    }
}

