SwiftGridView

@MainActor
open class SwiftGridView : UIView, UICollectionViewDataSource, UICollectionViewDelegate, SwiftGridLayoutDelegate, SwiftGridReusableViewDelegate

SwiftGridView is the primary view class, utilizing a UICollectionView and a custom layout handler.

Init

Public Properties

  • Internal Collectionview. Open to allow for custom interaction, modify at own risk.

    Declaration

    Swift

    @objc
    @MainActor
    open internal(set) var collectionView: UICollectionView! { get }
  • Allows IBOutlets to work properly. Required dataSource link of type SwiftGridViewDataSource

  • Allows IBOutlets to work properly. Required delegate link of type SwiftGridViewDelegate

  • Required dataSource link of type SwiftGridViewDataSource

    Declaration

    Swift

    @objc
    @MainActor
    open weak var dataSource: SwiftGridViewDataSource?
  • Required delegate link of type SwiftGridViewDelegate

    Declaration

    Swift

    @objc
    @MainActor
    open weak var delegate: SwiftGridViewDelegate?
  • Enable or disable selection for the entire gridview.

    Declaration

    Swift

    @objc
    @MainActor
    open var allowsSelection: Bool { get set }
  • When enabled, multiple cells can be selected. If row selection is enabled, then multiple rows can be selected.

    Declaration

    Swift

    @objc
    @MainActor
    open var allowsMultipleSelection: Bool
  • If row selection is enabled, then entire rows will be selected rather than individual cells. This applies to section headers/footers in addition to rows.

    Declaration

    Swift

    @objc
    @MainActor
    open var rowSelectionEnabled: Bool
  • Array of SwiftGridCell for all visible cells.

    Declaration

    Swift

    @objc
    @MainActor
    open var visibleCells: [SwiftGridCell] { get }
  • Array of IndexPath for all visible cells.

    Declaration

    Swift

    @objc
    @MainActor
    open var indexPathsForVisibleItems: [IndexPath] { get }
  • Array of IndexPath for any selected cells

    Declaration

    Swift

    @objc
    @MainActor
    open var indexPathsForSelectedItems: [IndexPath] { get }
  • When directional lock is enabled, the grid is only scrollable in one direction at a time (vertically or horizontally)

    Declaration

    Swift

    @objc
    @MainActor
    open var isDirectionalLockEnabled: Bool { get set }
  • Enables bouncing for the gridvies

    Declaration

    Swift

    @objc
    @MainActor
    open var bounces: Bool { get set }
  • Determines whether section headers will stick while scrolling vertically or scroll off screen.

    Declaration

    Swift

    @objc
    @MainActor
    open var stickySectionHeaders: Bool { get set }
  • default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag vertically

    Declaration

    Swift

    @objc
    @MainActor
    open var alwaysBounceVertical: Bool { get set }
  • default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag horizontally

    Declaration

    Swift

    @objc
    @MainActor
    open var alwaysBounceHorizontal: Bool { get set }
  • A Boolean value that controls whether the horizontal scroll indicator is visible. The default value is true. The indicator is visible while tracking is underway and fades out after tracking.

    Declaration

    Swift

    @objc
    @MainActor
    open var showsHorizontalScrollIndicator: Bool { get set }
  • A Boolean value that controls whether the vertical scroll indicator is visible. The default value is true. The indicator is visible while tracking is underway and fades out after tracking.

    Declaration

    Swift

    @objc
    @MainActor
    open var showsVerticalScrollIndicator: Bool { get set }
  • Pinch to expand increases the size of the columns. Experimental feature.

    Declaration

    Swift

    @objc
    @MainActor
    open var pinchExpandEnabled: Bool { get set }
  • Declaration

    Swift

    @objc
    @MainActor
    open var isTracking: Bool { get }

    Return Value

    YES if user has touched. may not yet have started draggin

  • Declaration

    Swift

    @objc
    @MainActor
    open var isDragging: Bool { get }

    Return Value

    YES if user has started scrolling. this may require some time and or distance to move to initiate dragging

  • Declaration

    Swift

    @objc
    @MainActor
    open var isDecelerating: Bool { get }

    Return Value

    YES if user isn’t dragging (touch up) but scroll view is still moving

  • Whether or not the gridView will automatically scroll to top when the status bar is tapped. Default is YES.

    Declaration

    Swift

    @objc
    @MainActor
    open var scrollsToTop: Bool { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    @MainActor
    open var refreshControl: UIRefreshControl? { get set }

Layout Subviews

Public Methods

SwiftGridReusableViewDelegate Methods

UICollectionView DataSource

UICollectionView Delegate