Hey, great video! I have a doubt that I have searched at multiple places but couldn't find the solution. While we are dragging one item from it's place, how can we make the original item disappear from its place and only make the preview visible until it is dropped at some proper location? So basically how can we completely detach the item while it is being dragged? Thanks
Hey Awesome video i would like to give you some video suggestion since its hard to find something like this in the internet it would be creating some small custom browser with swift as macOs desktop app
When running this code on macOS (14.0) the trick to find the source view with the onAppear on the draggable preview doesn't work correctly. It's only called after the window lost it's focus. Looks like a SwiftUI bug to me, but do you know some workaround or other method to identify the source view?
@@Kavsoft FYI, I have a workaround to add a "onTapGesture" at the RoundedRectangle, before ".graggable(color") RoundedRectangle(cornerRadius: 10) .fill(color.gradient) // start .onTapGesture { draggingItem = color } // stop .draggable(color) {
Hello, I have a question. I have to make two .onDrops in ScrollView called A View within NavigationStack. How do I handle .onDrops inside A View and .onDrops delivered outside B View? Everything that is delivered by drag and drop is a string
Thanks for your tutorial, and I have a question. How to implement the function of changing the display mode of the grid by clicking the toolbar? Thank you!!!
Oh, simple add a toolbar button and create a state variable called isToggled and update the toggle status inside the button action with animation, then change the grid column from 3 to 2 based on the toggle status, like this @State private var isToggled = false /// let columns = Array(repeating: GridItem(.flexible(), count: isToggled ? 2 : 3) /// ToolBarItem { Button{ withAnimation{ isToggled.toggle() } } label: { /// } }
Table Improvements OutlineGroup Column Reordering | Column Visibility - this is from, WWDC slide. Document Group, and of course Swift❤Data 👏👍👍👍 EDIT: Done, works on "Mac", but is some bug(?), on second "active" app window, reordering starts working...
Hello, I'm a paid subscriber, could I contact you for a custom version of this with variable width and heights like cells wrapping multiple columns/rows with drag and drop
Hey! I am using the grid you did here th-cam.com/video/VrwINubmq5g/w-d-xo.html with this variable height for each cards. When I try to make this Drag & Drop work I need to wrap my cards into a geometry reader that destroys the entire layout... How can I for instance keep the height dynamic for each cards? Thanks for your help!
Hey! I am using the grid you did here th-cam.com/video/VrwINubmq5g/w-d-xo.html with this variable height for each cards. When I try to make this Drag & Drop work I need to wrap my cards into a geometry reader that destroys the entire layout... How can I for instance keep the height dynamic for each cards? Thanks for your help!
thank you! please make drag n drop from one list to another, like kanban board
th-cam.com/video/iDnrraNom0o/w-d-xo.html
Swift UI seems like magic 😍
Awesome 👏
Brilliant
Hey, great video!
I have a doubt that I have searched at multiple places but couldn't find the solution.
While we are dragging one item from it's place, how can we make the original item disappear from its place and only make the preview visible until it is dropped at some proper location?
So basically how can we completely detach the item while it is being dragged?
Thanks
Hey Awesome video i would like to give you some video suggestion since its hard to find something like this in the internet it would be creating some small custom browser with swift as macOs desktop app
the onAppear trick doesnt seem to work. Do you know any other way to do it?
it does.
When running this code on macOS (14.0) the trick to find the source view with the onAppear on the draggable preview doesn't work correctly. It's only called after the window lost it's focus. Looks like a SwiftUI bug to me, but do you know some workaround or other method to identify the source view?
I too noticed that on macOS the on-appear is not appearing. I will find a way for that, and if so, I will update this comment!
@@Kavsoft FYI, I have a workaround to add a "onTapGesture" at the RoundedRectangle, before ".graggable(color")
RoundedRectangle(cornerRadius: 10)
.fill(color.gradient)
// start
.onTapGesture {
draggingItem = color
}
// stop
.draggable(color) {
It works. Except the animation when you drag. Do you know why?
Hello, I have a question.
I have to make two .onDrops in ScrollView called A View within NavigationStack.
How do I handle .onDrops inside A View and .onDrops delivered outside B View?
Everything that is delivered by drag and drop is a string
Check this video!
th-cam.com/video/iDnrraNom0o/w-d-xo.html
Thanks for your tutorial, and I have a question.
How to implement the function of changing the display mode of the grid by clicking the toolbar?
Thank you!!!
Do you mean changing layout from Vertical to Horizontal?
@@Kavsoft
The demonstration at 00:30 in the video
Oh, simple add a toolbar button and create a state variable called isToggled and update the toggle status inside the button action with animation, then change the grid column from 3 to 2 based on the toggle status, like this
@State private var isToggled = false
///
let columns = Array(repeating: GridItem(.flexible(), count: isToggled ? 2 : 3)
///
ToolBarItem {
Button{
withAnimation{
isToggled.toggle()
}
} label: {
///
}
}
@@Kavsoft Thank you so much!🤩
Table Improvements
OutlineGroup Column Reordering | Column Visibility - this is from, WWDC slide.
Document Group, and of course Swift❤Data 👏👍👍👍
EDIT: Done, works on "Mac", but is some bug(?), on second "active" app window, reordering starts working...
nice thumbnail
I can't find boucy Animation. is that your custom Animation??
Bouncy animation is available from iOS 17+
@@Kavsoft oh thank you😉
Hello, I'm a paid subscriber, could I contact you for a custom version of this with variable width and heights like cells wrapping multiple columns/rows with drag and drop
Work with iOS 16 ?
Yep!
Hey! I am using the grid you did here th-cam.com/video/VrwINubmq5g/w-d-xo.html with this variable height for each cards. When I try to make this Drag & Drop work I need to wrap my cards into a geometry reader that destroys the entire layout... How can I for instance keep the height dynamic for each cards? Thanks for your help!
Hey! I am using the grid you did here th-cam.com/video/VrwINubmq5g/w-d-xo.html with this variable height for each cards. When I try to make this Drag & Drop work I need to wrap my cards into a geometry reader that destroys the entire layout... How can I for instance keep the height dynamic for each cards? Thanks for your help!