SwiftUI - Reorder a List (2 Ways)

Published: 31 August 2024
on channel: Sean Allen
10,080
368

Go to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.

In this video I demonstrate two different ways to implement reordering a list in SwiftUI. First, I show you a way that was introduced in iOS 16 that's built right into List. Then I'll show you the classic .onMove that's been around for a while (in case you need to support older versions).

I also show you how to update the list order of all the items in case you need to save or persist this list order in between launches.

My iOS Dev Courses:
https://seanallen.teachable.com/

My Source Code:
https://seanallen.teachable.com/p/sou...

X (Twitter):
Sean Allen -   / seanallen_dev  

Hired.com:
https://hired.com/x/1n01g

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Mark Moeyken’s SwiftUI Books:
https://www.bigmountainstudio.com/a/f...

Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803

RocketSim - Enhance Your Xcode Simulator:
https://gumroad.com/a/51797971/ftvbh

Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843

Timestamps:
0:00 - 2 Ways to Reorder a List
0:17 - Start Project Review
1:35 - Reorder a List - First Method (new in iOS 16)
3:40 - onChange for Additional Logic
7:08 - Pros & Cons of Each Approach
8:24 - onMove Implementation - Second Method

#swift #softwaredeveloper #iosdeveloper


Watch video SwiftUI - Reorder a List (2 Ways) online, duration hours minute second in high quality that is uploaded to the channel Sean Allen 31 August 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 10,080 times and liked it 368 visitors.