Provide views, controls, and layout structures for declaring your app's user interface using SwiftUI.

Posts under SwiftUI tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

iOS 16.0 breaks GeometryReader or UIDevice.orientationDidChangeNotification notifications
In iOS 15.5 the correct GeometryProxy.size.height value is available when a UIDevice.orientationDidChangeNotification is received. In iOS 16.0 the GeometryProxy.size.height value is outdated it (reflects the value before rotation). Expected behavior: iPhone SE (3rd generation) (15.5) Landscape: Height is logged at 375.0. Portrait: Height is logged at 647.0. Actual behavior: iPhone SE (3rd generation) (16.0) Landscape: Height is logged at 647.0. Portrait: Height is logged at 375.0. Feedback FB10448199 import SwiftUI struct ContentView: View {   let orientationDidChangeNotification =     NotificationCenter       .default       .publisher(for: UIDevice.orientationDidChangeNotification)       var body: some View {     GeometryReader { geometryProxy in       Color.clear         .onReceive(orientationDidChangeNotification) { _ in           print(geometryProxy.size.height)         }     }   } }
1
3
1.1k
Oct ’23
ToolbarItemGroup(placement: .keyboard) is not showed with Sheet
struct ContentView: View {   @State var isPresented = false   var body: some View {     Button {       isPresented.toggle()     } label: {       Text("Button")     }     .sheet(isPresented: $isPresented) {       SubView()     }   } } struct SubView: View {   @State var text = ""   var body: some View {     NavigationStack {       TextEditor(text: $text)         .toolbar {           ToolbarItemGroup(placement: .bottomBar) {             Button("Click") {             }           }           ToolbarItemGroup(placement: .keyboard) {             Button("Click") {             }           }         }     }   } }
9
3
3k
Oct ’23
MyEqualWidthHStack WWDC example not working for me
Hi I really liked the video by Paul Lettieri, creating a replacement for HStack that gives equal width to each, so I wrote one for my app. But the app doesn't compile for me. It gives me "Trailing closure passed to parameter of type 'HorizontalAlignment' that does not accept a closure" against the top VStack, not the place where the equal lengths HStack replacement appears. This is my version of his struct: extension LayoutSubviews {       func maxSize() -> CGSize {     let subviewSizes = map { $0.sizeThatFits(.unspecified) }     return subviewSizes.reduce(CGSize.zero) { CGSize(width: Swift.max($0.width, $1.width), height: Swift.max($0.height, $1.height)) }   }// maxSize()       func spacing() -> [Double] {     return indices.map { index in       guard index < count - 1 else { return 0.0 }       return self[index].spacing.distance(to: self[index + 1].spacing, along: .horizontal)     }   }// spacing()     }// extension LayoutSubviews struct EqualWidthHStack: Layout {       func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {     let maxsize = subviews.maxSize()     let totalSpacing = subviews.spacing().reduce(0) { $0 + $1 }     return CGSize(width: maxsize.width * Double(subviews.count) + totalSpacing, height: maxsize.height)   }// sizeThatFits       func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {     let maxsize = subviews.maxSize()     let spacing = subviews.spacing()     let sizeProposal = ProposedViewSize(width: maxsize.width, height: maxsize.height)     var x = bounds.minX + maxsize.width / 2     for index in subviews.indices {       subviews[index].place(at: CGPoint(x: x, y: bounds.midX), anchor: .center, proposal: sizeProposal)       x += maxsize.width + spacing[index]     }   }// placeSubviews     }// EqualWidthHStack I wrote this trivial View to test it: struct ContentView: View {   var body: some View {     VStack {       HStack {         Button("Hi") { print("Hi!") }         Button("Hello") { print("Hello!") }         Button("Good evening") { print("Good evening!") }       }       EqualWidthHStack {         Button("Hi") { print("Hi!") }         Button("Hello") { print("Hello!") }         Button("Good evening") { print("Good evening!") }       }       Image(systemName: "globe")         .imageScale(.large)         .foregroundColor(.accentColor)       Text("Hello, world!")     }   } } I'm using Version 14.0 beta 2 (14A5229c) of Xcode. I was having a problem with the exact same message in another app with a much more complex main view. I hope someone can tell me what to do or what is going on here. Regards, Mark
5
1
1.4k
Feb ’24
UICollectionView How to make a cell size itself dynamically based on its UIHostingConfiguration?
I have made an UICollectionView in which you can double tap a cell to resize it. I'm using a CompositionalLayout, a DiffableDataSource and the new UIHostingConfiguration hosting a SwiftUI View which depends on an ObservableObject. The resizing is triggered by updating the height property of the ObservableObject. That causes the SwiftUI View to change its frame which leads to the collectionView automatically resizing the cell. The caveat is that it does so immediately without animation only jumping between the old and the new frame of the view. The ideal end-goal would be to be able to add a .animation() modifier to the SwiftUI View that then determines animation for both view and cell. Doing so now without additional setup makes the SwiftUI View animate but not the cell. Is there a way to make the cell (orange) follow the size of the view (green) dynamically? The proper way to manipulate the cell animation (as far as I known) is to override initialLayoutAttributesForAppearingItem() and finalLayoutAttributesForDisappearingItem() but since the cell just changes and doesn't appear/disappear they don't have an effect. One could also think of Auto Layout constraints to archive this but I don’t think they are usable with UIHostingConfiguration? I've also tried: subclassing UICollectionViewCell and overriding apply(_ layoutAttributes: UICollectionViewLayoutAttributes) but it only effects the orange cell-background on initial appearance. to put layout.invalidateLayout() or collectionView.layoutIfNeeded() inside UIView.animate() but it does not seem to have an effect on the size change. Any thoughts, hints, ideas are greatly appreciated ✌️ Cheers! Here is the code I used for the first gif: struct CellContentModel { var height: CGFloat? = 100 } class CellContentController: ObservableObject, Identifiable { let id = UUID() @Published var cellContentModel: CellContentModel init(cellContentModel: CellContentModel) { self.cellContentModel = cellContentModel } } class DataStore { var data: [CellContentController] var dataById: [CellContentController.ID: CellContentController] init(data: [CellContentController]) { self.data = data self.dataById = Dictionary(uniqueKeysWithValues: data.map { ($0.id, $0) } ) } static let testData = [ CellContentController(cellContentModel: CellContentModel()), CellContentController(cellContentModel: CellContentModel(height: 80)), CellContentController(cellContentModel: CellContentModel()) ] } class CollectionViewController: UIViewController { enum Section { case first } var dataStore = DataStore(data: DataStore.testData) private var layout: UICollectionViewCompositionalLayout! private var collectionView: UICollectionView! private var dataSource: UICollectionViewDiffableDataSource<Section, CellContentController.ID>! override func loadView() { createLayout() createCollectionView() createDataSource() view = collectionView } } // - MARK: Layout extension CollectionViewController { func createLayout() { let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50)) let Item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.8), heightDimension: .estimated(300)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [Item]) let section = NSCollectionLayoutSection(group: group) layout = .init(section: section) } } // - MARK: CollectionView extension CollectionViewController { func createCollectionView() { collectionView = .init(frame: .zero, collectionViewLayout: layout) let doubleTapGestureRecognizer = DoubleTapGestureRecognizer() doubleTapGestureRecognizer.doubleTapAction = { [unowned self] touch, _ in let touchLocation = touch.location(in: collectionView) guard let touchedIndexPath = collectionView.indexPathForItem(at: touchLocation) else { return } let touchedItemIdentifier = dataSource.itemIdentifier(for: touchedIndexPath)! dataStore.dataById[touchedItemIdentifier]!.cellContentModel.height = dataStore.dataById[touchedItemIdentifier]!.cellContentModel.height == 100 ? nil : 100 } collectionView.addGestureRecognizer(doubleTapGestureRecognizer) } } // - MARK: DataSource extension CollectionViewController { func createDataSource() { let cellRegistration = UICollectionView.CellRegistration<UICollectionViewCell, CellContentController.ID>() { cell, indexPath, itemIdentifier in let cellContentController = self.dataStore.dataById[itemIdentifier]! cell.contentConfiguration = UIHostingConfiguration { TextView(cellContentController: cellContentController) } .background(.orange) } dataSource = .init(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } var initialSnapshot = NSDiffableDataSourceSnapshot<Section, CellContentController.ID>() initialSnapshot.appendSections([Section.first]) initialSnapshot.appendItems(dataStore.data.map{ $0.id }, toSection: Section.first) dataSource.applySnapshotUsingReloadData(initialSnapshot) } } class DoubleTapGestureRecognizer: UITapGestureRecognizer { var doubleTapAction: ((UITouch, UIEvent) -> Void)? override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) { if touches.first!.tapCount == 2 { doubleTapAction?(touches.first!, event) } } } struct TextView: View { @StateObject var cellContentController: CellContentController var body: some View { Text(cellContentController.cellContentModel.height?.description ?? "nil") .frame(height: cellContentController.cellContentModel.height, alignment: .top) .background(.green) } }
2
1
3.1k
Dec ’23
TextField with Double or Int not binding back ?
Hi there, In a SwiftUI View, I have a @State var test: Double? and a TextField like that : TextField("Test", value: $test, formatter: NumberFormatter()) the variable test is constantly nil and never being populated with the Double value of the entered text. Is it a bug or a concept error of mine ?? Thanks!
2
1
1.6k
Jan ’24
SwiftUI slider in accessibilityRepresentation & XCUITest slider's normalizedSliderPosition
Hi everybody, given the following case using SwiftUI: Button("testButton", action: noop) .accessibilityRepresentation{representation: { Slider(value: $sliderData.sliderValue) }) .accessibilityIdentifier("testSlider") I'm trying to control the slider using XCUITest via slider.adjust(toNormalizedSliderPosition: 0.2) and receive the following error message: Failed: Unable to get expected attributes for slider, found { "XC_kAXXCAttributeMaxScrubberPosition" = { X = 0; Y = 0; }; "XC_kAXXCAttributeMinScrubberPosition" = { X = 0; Y = 0; }; Similarly, print (slider.normalizedSliderPosition) leads to the error message "Failed to determine current position of slider "0 %". Is there a way to set and read the value of accessibilityRepresentation-Sliders with XCUITest? Thanks!
2
1
1.1k
Jan ’24
Use context menu to navigate to another view
I would like to use a context menu item to navigate into a different view. .contextMenu { Button { // Navigate to a view     } label: {     Label("Add to playlist", systemImage: "music.note.list") } } There are multiple items in the context menu. I have tried to wrap the button into a NavigationLink but there is no response when selecting the context menu item.
2
1
740
Sep ’23
`NSVisualEffectView` not working in `SwiftUI`
Bellows are the codes in Swift Playground. import PlaygroundSupport import SwiftUI struct VisualEffectView: NSViewRepresentable { let material: NSVisualEffectView.Material = .contentBackground let blendingMode: NSVisualEffectView.BlendingMode = .withinWindow func makeNSView(context: Context) -> NSVisualEffectView { let visualEffectView = NSVisualEffectView() visualEffectView.material = material visualEffectView.blendingMode = blendingMode visualEffectView.state = NSVisualEffectView.State.active return visualEffectView } func updateNSView(_ visualEffectView: NSVisualEffectView, context: Context) { visualEffectView.material = material visualEffectView.blendingMode = blendingMode } } struct ContentView: View { var body: some View { ZStack { Image(nsImage: #imageLiteral(resourceName: "background.jpg")) .resizable() .aspectRatio(contentMode: .fill) .frame(width: 400, height: nil, alignment: .center) VisualEffectView() } } } PlaygroundPage.current.setLiveView(ContentView()) The codes result in white area with the Image invisible.
1
0
634
Jul ’23
FileDocument, Transferable, and DocumentGroup
I'm having a hard time reconciling DocumentGroup with the new APIs using Transferable. Setting up an app with DocumentGroup using a FileDocument type gives you undo/redo and file-specific app opening behavior out of the box (even though the navigation view implicitly present in DocumentGroup is a nightmare to work with). Now with Transferable we're given the ability to set up representations to share, drag/drop, copy/paste, etc. The point where these collide in a confusing way is in the .navigationDocument API., which sets up elements in the navigation bar to interact with a "document" that is Transferable. This would be great to include in a DocumentGroup scene backed by a FileDocument, but FileDocument is not currently Transferable and furthermore the Navigation View underlying the DocumentGroup isn't easily exposed. This really muddies the story around how to build document-based applications. Where does DocumentGroup fit in now that Transferable exists? Should I be providing my own conformance to Transferable on my FileDocument, reach down into the implicit NavigationView of DocumentGroup to get the new .navigationDocument functionality? Is DocumentGroup soon to be deprecated (or at least not for a more sophisticated use case) and apps should be built with Transferrable types in a normal WindowGroup that implements all of the other goodies that exist in DocumentGroup? Any clarity around the intention with DocumentGroup and how such an app would fit into a world of Transferables would be greatly appreciated!
1
0
1.2k
Jul ’23
Keep Menu Open on SwiftUI?
Is there a way to keep the menu open after tapping on a button or toggle inside it instead of automatically minimizing it on every tap? This isn't a feature that's going to production ever, by the way. My code is something like this: struct MyView: View {     @State var toggleA = true     @State var toggleB = true     @State var toggleC = true     var body: some View {         NavigationView {             SwiftUI.Form {                 Text("Hello")             }             .navigationTitle("My View")             .navigationBarTitleDisplayMode(.inline)             .navigationBarItems(trailing: {                 Menu {                     Toggle("A", isOn: $toggleA)                     Toggle("B", isOn: $toggleB)                     Toggle("C", isOn: $toggleC)                 } label: {                     Image(systemName: "ellipsis.circle")                 }             }())         }     } } struct Preview: PreviewProvider {     static var previews: some View {         MyView()     } }
3
2
977
Jan ’24
NavigationSplitView two and three column interfaces in the same app
I am currently learning to create multiplatform applications using SwiftUI and NavigationSplitView, and I faced the problem of arranging different Views in the same App. Let's open the default Notes application, and here, we can see a switch between two and three-column views of the content. So my question is, how to arrange this kind of view for different App pages using NavigationSplitView? First page has two columns interface Second has three columns
3
0
2.8k
Aug ’23
iOS 16: toolbar and navigationView
Hi everyone, I am experiencing an issue with Toolbar and NavigationView on iOS 16. Here are two small views to explain my bug: struct ContentView: View {     var body: some View {         NavigationView {             VStack {                 NavigationLink(destination: OtherView()) {                     Text("Link to OtherView")                 }             }         }     } } struct OtherView: View {     var body: some View {         ScrollView {             Text("ScrollView")         }         .toolbar {             ToolbarItem(placement: .bottomBar) {                 Text("Great Toolbar")             }         }     } } The toolbar of OtherView is displayed but is empty: If I replace NavigationView with NavigationStack, it works well: However, I should use a NavigationView because my app is available on iOS 15. Would you know how to solve this? Thank you, regards
6
1
3.4k
Nov ’23
iOS 16.0 beta 7 broke Text(Date(), style: .timer) in SwiftUI widgets
Hi, In my apps, the recent iOS 16.0 beta 7 (20A5356a) broke the .timer DateStyle property of the Text view, in a SwiftUI widget. In previous OS and beta, Text(Date(), style: .timer) was correctly displaying an increasing counter. In iOS 6.0 beta 7, Text(Date(), style: .timer) does not update anymore, (and is offset to the left). The other DateStyle (like .offset, .relative, ...) seems to update correctly. Anyone noticed that (very specific) problem ?
38
14
9k
Feb ’24
Crash Xcode 13.4 swift::fatalError Xcodebuild
Lately we have added swift code to our SDK. (especially swiftUI library). The SDK deployment target is ios9. While importing the SDK to the hosting app with the same deployment target and building via Xcode (13.4) everything works fine. When we try to build it via xcodebuild (xcodebuild -workspace UIKitCatalog.xcworkspace -scheme UIKitCatalog -sdk "iphonesimulator") the build is done successfully but the the app is crashing on app lunch (sim and device) . Increasing the deployment target of the hosting app to iOS 13 fixes the issue (unfortunately we cant force our customers to do the same) CrashReporter Key: 74B25560-EFCE-769F-F0B4-E4DD4C6B09A4 Hardware Model: MacBookPro15,1 Process: UIKitCatalog [63980] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/F044CBD3-80D6-49FB-BAC9-FA48FA3CFF7E/data/Containers/Bundle/Application/72290230-2DB3-4F75-8327-75B6E4E9947C/UIKitCatalog.app/UIKitCatalog Identifier: ba.UIKitCatalog Version: 2.0.0.23386 (23386) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [56632] Coalition: com.apple.CoreSimulator.SimDevice.F044CBD3-80D6-49FB-BAC9-FA48FA3CFF7E [10638] Responsible Process: SimulatorTrampoline [2048] Date/Time: 2022-08-29 11:59:21.3026 +0300 Launch Time: 2022-08-29 11:59:19.9381 +0300 OS Version: macOS 12.5.1 (21G83) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 0 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x7fff7017300e __pthread_kill + 10 1 libsystem_pthread.dylib 0x7fff701cb1ff pthread_kill + 263 2 libsystem_c.dylib 0x7fff2010b6b7 abort + 130 3 libswiftCore.dylib 0x10e7c0af5 swift::fatalError(unsigned int, char const*, ...) + 149 4 libswiftCore.dylib 0x10e7b86ec checkVersion() + 44 5 dyld_sim 0x10d0689f7 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 182 6 dyld_sim 0x10d0850f5 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 129 7 dyld_sim 0x10d07e58c invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 555 8 dyld_sim 0x10d07d6e9 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 129 9 dyld_sim 0x10d07e31f dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 179 10 dyld_sim 0x10d084b56 dyld3::MachOAnalyzer::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, unsigned char const*, bool&) block_pointer) const + 118 11 dyld_sim 0x10d084d98 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 386 12 dyld_sim 0x10d06892a dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 144 13 dyld_sim 0x10d068ac2 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 190 14 dyld_sim 0x10d068aa5 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 161 15 dyld_sim 0x10d068aa5 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 161 16 dyld_sim 0x10d068b60 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 102 17 dyld_sim 0x10d077b5a dyld4::APIs::runAllInitializersForMain() + 222 18 dyld_sim 0x10d05b9fe dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 2528 19 dyld_sim 0x10d05be42 _dyld_sim_prepare + 379 20 dyld 0x110e6eb78 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1265 21 dyld 0x110e6d70e dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 244 22 dyld 0x110e6d4e4 start + 388 How can we overcome this issue? What Xcode is doing under the hood that xcodebuild doesnt do? Is it possible to release an SDK which import swiftUI but will have deployment target lower than 13. (I have wrapped all the the swift code with @available() and #if canImport(SwiftUI) - less relevant as its compile time )
3
0
2.4k
Sep ’23
How to switch SwiftUI Views?
Hello. I am stuck on this one problem, and I can't fix it. I'm very new to Swift, but I have used other languages. I searched all over the internet, and it does not work. I tried doing something similar to this: Button("Press Me") { view2() } It doesn't do anything. It's spelled correctly. If it helps, it also gives a warning of "Result of 'Username' initializer is unused" Does anyone know why this is happening?
4
1
5.6k
Aug ’23
UITouch after SwiftUI Drag
I'm implementing a SwiftUI control over a UIView's drawing surface. Often you are doing both at the same time. Problem is that starting with the SwiftUI gesture will block the UIKit's UITouch(s). And yet, it works when you start with a UITouch first and then a SwiftUI gesture. Also need UITouch's force and majorRadius, which isn't available in a SwiftUI gesture (I think). Here's an example: import SwiftUI struct ContentView: View { @GestureState private var touchXY: CGPoint = .zero var body: some View { ZStack { TouchRepresentable() Rectangle() .foregroundColor(.red) .frame(width: 128, height: 128) .gesture(DragGesture(minimumDistance: 0) .updating($touchXY) { (value, touchXY, _) in touchXY = value.location}) .onChange(of: touchXY) { print(String(format:"SwiftUI(%.2g,%.2g)", $0.x,$0.y), terminator: " ") } //.allowsHitTesting(true) no difference } } } struct TouchRepresentable: UIViewRepresentable { typealias Context = UIViewRepresentableContext<TouchRepresentable> public func makeUIView(context: Context) -> TouchView { return TouchView() } public func updateUIView(_ uiView: TouchView, context: Context) {} } class TouchView: UIView, UIGestureRecognizerDelegate { func updateTouches(_ touches: Set<UITouch>, with event: UIEvent?) { for touch in touches { let location = touch.location(in: nil) print(String(format: "UIKit(%g,%g) ", round(location.x), round(location.y)), terminator: " ") } } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { updateTouches(touches, with: event) } override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { updateTouches(touches, with: event) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { updateTouches(touches, with: event) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { updateTouches(touches, with: event) } } Because this is multitouch, you need to test on a real device. Sequence A: finger 1 starts dragging outside of red square (UIKit) finger 2 simultaneously drags inside of red square (SwiftUI) ⟹ Console shows both UIKit and SwiftUI touch positions Sequence B: finger 1 starts dragging inside of red square (SwiftUI) finger 2 simultaneously drags outside of red square (UIKit) ⟹ Console shows only SwiftUI touch positions Would like to get both positions in Sequence B.
2
0
1.5k
Aug ’23
SwiftUI, List items reordering issue (iOS 16)
Hello, On iOS 15, I had a feature who allow the user to reorder some items inside of a list. Some view was not allowed to move (I use the modifier .moveDisabled for this behavior). In iOS 15, everything was working fine : I'm able to reorder items inside of the list (only for those who was allowed to be moved). But in iOS 16, I have a strange behavior : I still can reorder items, but if two items are not allowed to be reordered, I can't move any items between them. Here is the example : iOS 15 : iOS 16 : For this feature, I only use: standard SwiftUI List. .environment(\.editMode, .constant(.active)) (the view should always be editable). .moveDisabled() to allow items to be moved. No custom element here, everything is SwiftUI framework. What am I doing wrong? Thanks, Alexandre
5
5
2.4k
Sep ’23