Swift Drag&Drop - Move multiple items at once within the same collectionView - ios

I'm currently trying to implement Drag&Drop in my app. I've watched this:
https://developer.apple.com/videos/play/wwdc2017/223/
(There's also a downloadable project that exactly showcases what I'm about to ask)
There's one thing I don't understand and that's this:
When I drag one item, I can drop it within the same collection view. However, that's not working anymore when I drag multiple items. No "gap" is created and when I drop the items, they just go back to their old positions.
Does this have any specific reason I'm not seeing? Because I'd love to have this feature.
I mean, I probably could implement the actual "moving the data" part (it's just a case that the demo project is not considering), but I see no way of adding this "gap" while hovering over the items.
Thanks for any advice :)

This is currently not supported with the latest set of APIs (as of iOS 13). It's possible to do by returning a proposal with intent .unspecified and drawing a drop indicator manually.
See tweet reply from Tyler Fox, Apple engineer.

I haven’t tried moving multiple items before, but the way you “create space” for a single item is by using collectionView.beginInteractiveMovementForItem(at: IndexPath) and it’s companion functions. https://developer.apple.com/documentation/uikit/uicollectionview/1618019-begininteractivemovementforitem

Related

Detecting screen interaction outside of the component in SwiftUI

I'm building my own custom list using LazyVStack with swipeable actions thanks to this tutorial: https://prafullkumar77.medium.com/swiftui-how-to-make-custom-swipe-able-cell-727a27abdddd
It isn't half bad as long as you read through it and understand it instead of just copying and pasting. However, much like all the currently available open-source frameworks out there, it is missing a core feature that I don't know if people are just forgetting about or it's just not possible so I thought I'd ask because I can't figure it out.
In a native list in UIKit, if you drag a list item to the semi-open state and have one of the list item actions visible but then interact anywhere else in the list via drag or tap, it will dismiss the currently visible list item action. Dismissing the action is the easy part, it's telling it to dismiss which puzzles me.
I know there are many things apple can do that isn't publicly available but this does seem like something that should theoretically be possible. I'd like to figure this out and make it publicly available as these swipeable actions are a key feature apple seemingly forgot to add before deciding to move towards these lazy stacks.

Which Controls do I have to choose in iOS development

an iOS app page, which descirbes some item's detail
This is kind of what I want to make
This is exact what I want
Actually I am not an iOS developer.
But a member of our team lacks of knowledge of consisting of iOS app Page(Scene)
I think he usually use table view all the time. which I guess he can't handle very well.
He always struggle about height of UITableView in dynamic pages.
As you see in the picture, page has two views, which I don't know how to call it.
If round button on the right side of a woman is pressed those two views switches.
I guess it's kind of "TAB".
Is it normal that using UITableView in this kind of page. or Which is best practise?
Thanks in advance and sorry for my english.
The first image can be made using a UITableView or UICollectionView(UITableView will do the job with lesser hassle). For second image, you'd wanna use a segmented control.
The third can be built using UICollectionView, however, there are plenty of third party libraries out there on github for the same and you might wanna check them out.
Last but not the least, have some faith in your developer. He seems to be a newbie if he's facing troubles with tableviews but believe me, we've all been there some day.Encourage him to ask questions on various communities. If he's curious enough, he'll be just fine after a while.

How to customize Apple CareKit?

In CareKit there are Care Card and Symptom tracker. I'm not understanding how to customize Carecardviewcontroller and symptomtrackerviewcontroller. I don't want to use these view controllers but interested in using components of these view controllers. there is no clear documentation to explore this.
(source: carekit.org)
If you are coming at this from a Swift perspective, then it has to be admitted that CareKit is about as "un-Swifty" as anything you can imagine. The GitHub site is certainly a start, but there is a horrific gap between reading the programming guides there and actually implementing a solution. It certainly has been a long slog for me!
That said, you can add customization to CareKit's story-board-free approach by using the view controller delegate functions that CareKit provides.
For example, suppose you have an app that reminds your user to perform two intervention activities, (1) take aspirin and (2) go for a brisk walk. If the user opens the Care Card and taps an event icon (one of the circles) for "take aspirin" then that will fire a method in the OCKCareCardViewControllerDelegate called:
careCardViewController(_ viewController: OCKCareCardViewController,
didSelectButtonWithInterventionEvent: OCKCarePlanEvent)
In this method you can segue to whatever view controller you'd like. E.g. if the event is for taking aspirin then display a view controller that shows a photo of an aspirin table, a reminder that it should contain just an 81 mg dose, and a recommendation about taking it with water.
Of course, nothing is ever easy with CareKit. It turns out that you will probably also want to turn off CareKit's standard practice of calling an event completed if the circle icon is tapped. That is accomplished by returning "false" from another delegate method called:
careCardViewController( _ viewController: OCKCareCardViewController,
shouldHandleEventCompletionFor
interventionActivity: OCKCarePlanActivity )
-> Bool
There is a book called Beginning CareKit Development that I can cautiously recommend. It was written for an earlier version of Swift and you have to do a lot of "translation" to get things to work with Swift 3. The last time I checked the GitHub repository for the code associated with the book was also entirely in this earlier version. APress will provide the code updated to Swift 3 if you ask. On the Kindle there are numerous little glitches with the book, including an index that has no page numbers nor hyperlinks to the associated text, very odd formatting choices that make the text sometimes hard to distinguish from code, and occasional errors in the solution code. All that said, I doubt that I'd have made any progress with CareKit without the book's help.
I've been looking for this answer myself.
As far as I researched, you can customize this screen visually with UIAppearance.
AND/OR you can create a new screen like this one from scratch using its behavior.
You can check the CareKit source code for hints on this: https://github.com/carekit-apple/CareKit/tree/master/CareKit/CareCard
There you'll notice some interesting classes/files:
OCKCareCardWeekView
OCKWeekLabelsView
OCKHeartView
OCKHeartButton
OCKWeekViewController
OCKHelpers
CareKit draws each screen via code. You can see how they do it by reading the code.
The idea is to create your own ViewController with these pieces, or one from scratch.
Surely it's not as trivial as just using CareCardViewController, but this will get you there.

Ios default icon for open view from list

In every ios app you can have a list that contains elements with subelements.
Tapping on the element will open a new page and you can usually press back to return.
This is indicated with a grey ">" symbol on the right.
Is this symbol downloadable somewhere? I know i can just type a > but it doesn't look exactly like the default icon used by ios.
I'm using Xamarin dialog and a standard RootElement embedded as a list item looks exactly like the default ios but i need to customize it with an icon placed left of the text(which is no problem except that i now lose the default > icon).
Googling for ios system icons, ios default icons and ios sdk did not yield the wanted result. I'm hoping that these icons are somewhere embedded on the device.
I hope you guys can help me out, thanks !
As far as I know there is no way to access a UIImage instance of the chevron during run time. Most likely there is private API for this, but I am not aware of it, and since it's private you are not allowed to use it anyway.
You could probably instantiate a cell that has the disclosure indicator as accessoryType and walk the view hierarchy to find it. But that will break easily, so don't do it.
The best way is to add an image and update it with every new iOS release.
There's the iOS Artwork Extractor which basically gets you every piece of artwork that is used in iOS.
The artwork you are looking for should be named UITableNext. (at least that's the name in iOS6, I don't have an extracted archive of iOS7 yet)
Strictly speaking you are violating Apples rules and their copyright if you use their artwork without Apples written consent.
As far as I know this has never been enforced, and lots of people do it, but it's good to keep it in mind.

iOS drag and drop with combination

I'm trying to figure out if this sort of thing is possible in iOS.
I'd like to have a UI where the user can drag "bubbles", each representing a noun, from a source pool into a destination panel. In addition, I'd like to be able to have another word pool of bubbles, each with adjective bubbles. These adjective bubbles could be dragged over noun bubbles already in the destination panel in order to modify them, making a combined bubble.
Mock-up of what I'm envisioning:
Is this possible in iOS (any versions)? Preferably using stock controls, but any way is fine. I will admit I have never worked with Objective-C or iOS dev before, but I am aiming for this sort of interface for my app, and want to see if it's at all possible.
Yes, this is certainly possible - but not something you could use 'stock' controls for. I would recommend learning about UIGestureRecognizer classes, try this tutorial for starters:
UIGestureRecognizer Tutorial in iOS 5: Pinches, Pans, and More!

Resources