SwiftUI - Reorder a List (2 Ways)

Опубликовано: 31 Август 2024
на канале: 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


Смотрите видео SwiftUI - Reorder a List (2 Ways) онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Sean Allen 31 Август 2024. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 10,080 раз и оно понравилось 368 посетителям.