Post

Replies

Boosts

Views

Activity

Problem with multiple drag and drop
I have been trying to get the drag and drop to work on iOS 26 betas. Single drag is okay, but I thought this year we were getting multi-select drag added. creating a simple object that can be dragged. Using the .draggable and added dropDestination which does trigger. The problem is the dragContainer does nothing. Not really clear what it is supposed to do. How am I supposed to allow for multiple item drag and drop like the Photos app? In there you can start a drag and tap additional photos to add to the drag. I can do this with a UICollectionView, but not with SwiftUI. struct DragObject: Codable, Identifiable, Transferable { var index: Int enum Keys: String, CodingKey { case index } var id:Int { index } public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: Keys.self) try container.encode(self.index, forKey: .index) } static public var transferRepresentation: some TransferRepresentation { CodableRepresentation(contentType: .json) } } @available(iOS 26.0, *) struct DragDropTestView: View { @State var items : [DragObject] = (0..<100).map({ DragObject(index: $0) }) @State var selected : [DragObject.ID] = [] var body: some View { let _ = Self._printChanges() ScrollView { Text("Selected \(selected)") LazyVGrid(columns: [GridItem(.adaptive(minimum: 150, maximum: 180))], alignment: .center, spacing: 10) { ForEach(items, id: \.index) { item in VStack { Text("\(item.index)") } .frame(width: 100, height: 100) .padding() .background(Color.blue) .cornerRadius(8) .contentShape(.dragPreview, Circle()) .draggable(item) .dropDestination(for: DragObject.self) { draggedItems, session in print("Dragged Item Count: \(draggedItems.count)") } } } } .dragContainer(for: DragObject.self, selection: selected){ ids in dragItems(ids: ids) } } func dragItems(ids: [Int]) -> [DragObject] { return ids.map({ DragObject(index: $0)}) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
0
0
183
Jul ’25
_MediaPlayer_AppIntents compilation error for iOS 26
getting an interesting error attempting to compile my app in Xcode 26 beta. error: Unable to find module dependency: '_MediaPlayer_AppIntents' (in target 'icatcher' from project 'icatcher') note: A dependency of main module 'MainModuleCrossImportOverlays' (in target 'icatcher' from project 'icatcher') Unable to find module dependency: '_MediaPlayer_AppIntents' Not sure what to try and pull to fix this issue
1
1
88
Jun ’25
18.4 broke URLSession Downloads
Getting cannot parse response on all downalod tasks. Example output "BackgroundDownloadTask <E277D3D6-2FF0-4574-A617-1612ED779151>.<1>", "LocalDownloadTask <E277D3D6-2FF0-4574-A617-1612ED779151>.<1>" ), NSLocalizedDescription=cannot parse response, _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://traffic.megaphone.fm/ESP7536701051.mp3?updated=1740573440, NSErrorFailingURLKey=https://traffic.megaphone.fm/ESP7536701051.mp3?updated=1740573440} Can't seem to find a workaround that i can push for app to work with 18.4 beta. Can't believe that beta went to the public.
2
1
524
Feb ’25
iOS 18 SwiftUI navigation bar problem
Okay I know, fill a bug... but here is a super simple app that will demostrate that the navigation bar chnages from Dark scheme to light scheme when you tap back after it goes to the second view. import SwiftUI struct ContentView: View { var body: some View { NavigationStack { NavigationLink { Text("Tap back and notice the navigation title changes to black text instead of white") .toolbarBackground(.visible, for: .navigationBar) .toolbarBackground(Color.orange, for: .navigationBar) .toolbarColorScheme(.dark, for: .navigationBar) } label: { VStack { Text("First page is the sweetest") } .padding() } .navigationTitle("First Page") .toolbarBackground(.visible, for: .navigationBar) .toolbarBackground(Color.orange, for: .navigationBar) .toolbarColorScheme(.dark, for: .navigationBar) } } } #Preview { ContentView() }
6
9
4.5k
Sep ’24
Expose ContextMenu as annoucable
I have a list of items that have swipe actions that I'd like to hide from accessibility and make actions available via the AccessibilityActions modifier. Additionally, I would like to make the contextMenu annoucable as an action. This behavior exists in the Apple Podcasts app but can't find out to do it in SwiftUI. If the users knows to use the triple-tap, they can activate the context menu but have it as an action of the element is even better.
0
0
548
Sep ’24
LazyVGrid and multi item drag
The List control allows for multi selection and works seamlessly to select multiple items fro draggable. This does not work with LazyVGrid. I can only get a single item to drag. Tapping another item does not add to the drag collection. Is this not supported? You can see this work just fine in the Photos app. You can drag an item and easily add additional by tapping another while dragging. Just want this behavior in SwiftUI
Topic: UI Frameworks SubTopic: SwiftUI
3
0
678
Sep ’24
draggable modifier and Updatable Preview View
I am having to do some custom drag and drop with the draggable modifier and I am using a Preview, but I can't get the preview to update when there are more items being dragged. The original Preview remains static. Is this not possible to update a View that is being dragged?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
398
Sep ’24
RefreshControl missing/malfunctioning plus/max phones
While I haven't seen this personally, just shared video from users, but in my app i have UITableViewController subclasses that use the UIRefreshControl for pull to refresh. For some strange reason on the iPhone max and Plus devices it is like the refresh part doesn't show at all. So you can't do a pull to refresh. The biggest change i had made was switching to SceneDelegates. I have no idea how that would be related.
2
0
763
Nov ’20