So in my project, I'm trying to drag a cell from one UICollectionView and drop the cell in another UICollectionView. Now I can successfully drop the cell. However, after I drop the cell in UICollectionView2, I don't know how to remove it from UICollectionView1. I figure I could use an observer pattern to do this. But I'm wondering if there is a built-in function in the API that does it? I looked up online and I don't see a tutorial that shows this. So can anyone help me with this? Thanks!
Related
I am building an app which enables user to drag a UIView onto another. Currently I have the implementation as a UIScrollView but that does not give me the best experience as to achieve an experience like Apple's drag and drop requires handling of many cases ( including edge cases).
I am curious if this can be done using a UICollectionView. I am looking to drag cells onto another cells after which the cells contents merge and the source cell is removed.
Any idea/ suggestion would be appreciated. I am not sure if adding what I have is neccessary but if needed I can certainly add the code which I have.
Yes, using a collectionView would be a good choice for scrolling and drag/drop. There are many built in methods that support drag and drop.
https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/supporting_drag_and_drop_in_collection_views
I am using CHTCollectionViewWaterfallLayout as the layout for my collectionView, since my cells do all have different sizes. But I would also like to implement drag & drop in my collectionView. The libraries I have found would not allow me to implement both at the same time. Is there any way to do this?
Thanks
I found a way to do it, I used one of the existing Drag 'n Drop libraries and made sure it inherited from the CHTCollectionView instead of the UICollectionViewFlowLayout, this worked pretty good! Still some errors to work out, but the beginning is there
I have a dynamic Prototype Table View with 7 cells within it. I am looking for a way to make the last cell a drop down menu. The last cell will be called policies and hopefully break into the actual polices by being a drop menu / sub menu. Hopefully this makes sense. I am using swift and latest iOS.
Thanks
Sam
Found this link from github hopefully it will help people out in the future. https://github.com/fawazbabu/Accordion_Menu
I want to have a similar functionality like we have with the UITableViewCellReorderControl from the UITableViewCell, but as far as I know I cant use the reordercontrol.
I have implemented Drag & Drop for multiple UITableViews. I can Drag a cell from any TableView to any other. Drag & Drop does work so far. Now I want to push the cells apart when I'm dragging an object over 2 cells, just like Apple does this in Tableviews or when you reorder your apps (the place where you might drop gets empty to indicate the droplocation).
The solutions I thought about are:
1. Insert a placeholder image at the droplocation (this is not so good as I have to sync with CoreData all the time)
2. Change the height of the cell to simulate empty space below it.
I dont think that are the best solutions.
Can someone go help me figure out how to hookup the table view so that i can add items to the table view? I'm trying to make a news screen for this app and am having trouble adding data to it. I have the xib file all set up i just don't know how to hook it all up in xcode 4.
It looked like you have not use UITableView class before. I would suggest get one of the samples from Apple. Here is the link.