Creating Movable Grids in SwiftUI

By Balaji Venkatesh / Jul 1, 2023

iOS 17

Animations

individualPage
individualPage
subTitle
date
Jul 1, 2023
isFolder
isFolder
slug
swiftui_5.0_movable_grids_jun23
status
status
tags
iOS 17
Animations
summary
This video explains how to create movable grids in SwiftUI using the .draggable(Transferable) and .dropDestination() modifiers, which allow for easy drag and drop reordering of grid items. These modifiers are available from iOS 16+
type
SwiftUI 5.0
In this video, I will explain how to create movable grids by reordering grid items using drag and drop. It is easy to achieve this using two SwiftUI modifiers:
  1. .draggable(Transferable)
  1. .dropDestination()
These modifiers are available from iOS 16+ and make it easy to create reordering grids. For more information about the end result, please refer to the attached GIF.
notion image
To learn more about the implementation, please watch the YouTube video.
Video preview
 

Copyright © Kavsoft 2020 - 2023