Skip to content

Instantly share code, notes, and snippets.

View druvv's full-sized avatar

Dhruv Sringari druvv

  • SmartPass
  • New York, New York
View GitHub Profile
@druvv
druvv / DragSelectContainerView.md
Last active March 5, 2024 16:56
Drag to select multiple views in SwiftUI

DragSelectContainerView

Drag to select multiple views in SwiftUI (Written in Swift 5 / iOS 15)

This wrapper view allows you to select multiple views in SwiftUI. You provide the view frames using a GeometryReader and the functionality to support selecting and deselecting objects. This wrapper takes care of the rest.

//
//  DragSelectContainerView.swift
//