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)})
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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
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.
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()
}
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.
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
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
Creating AppEntity objects for use as AppIntents to do filtering no longer works in iOS 17.4. If you have a prior shortcut setup that does that, then it will work. It seems some apps still work, but mostly i see the app shortcut action no longer has the Filtering options.
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.
As far as i can tell there is no way to load a different watch kit storyboard for different Watch OS versions. You can do it on the phone, but not the watch. Anyone know a way to do it on the watch?
Gets really difficult to support 3 OS versions of the watch when you can't configure every option in code and have to use the storyboards