MPMediaPickerController doesn't indicate selection when allowsPickingMultipleItems = true - ios

MPMediaPickerController used to give a visual indication that an item was selected prior to iOS 8.4.
In 8.4 when a picker is displayed and allowsPickingMultipleItems is set to true, it does show that items are selected in mediaPicker:didPickMediaItems but while picking, selected items simply highlight (sometimes) but then just flip back to a normal display without highlighting the + indicator.

Prior to iOS 8.4, when selecting multiple items using MPMediaPickerController the selected items remained highlighted to indicate selection. Additionally, it was not possible to select an item multiple times.
As of iOS 8.4, selecting an item simply highlights it for a brief period of time and the user can select the same item multiple times without being aware that she has already selected the item.
Steps to Reproduce:
1. Implement an instance of MPMediaPickerController (init with MPMediaTypeMusic)
2. Set "allowsPickingMultipleItems" to "YES"
3. Present the controller modally and try selecting an item
Expected Results:
Selected item should remain highlighted to indicate selection and it should not be possible to select an item multiple times
Actual Results:
Selected items are not reflected (aside from a brief highlight - dehighlight) and it's possible to select an item multiple times mistakenly.

I was able to fix this issue by remaking the MediaPickerController every time I wanted to use it.
I used to keep it around in the global scope to prevent having to remake it every time the user wanted to pick something.
Now when I select a song or an album the checkmark always shows up, so it is fixed.
It used to be that selecting songs or albums on the second presentation of the same MediaPickerController didn't show a checkmark when the user selected a song, however it would select the song anyway.

Related

How to navigate from one dropdown menu to next dropdown menu in iOS?

In whatsapp, when we go to any particular user then at right corner there is more option (three dots menu). Then after clicking that menu, one list will come and again at last row there is navigate arrow, then after clicking on that row again new menu will come.
here is the images,
after clicking on more option, following view will appear
I want to implement this feature in my iOS Project. Anyone have any idea how to implement it ?
You can manage it with multiple ways!
First Way : Take two table view for the menu. Initially keep one tableview hidden. Then on more's click of first tableview, show second tableview and hide firt one.
Second Way : Take only one tableview and reload different data. I mean on click of main change your datasource for tableview and reload it.
DropDown menu's are considered bad practice in iOS. Use one UIAlertController to show first options, than on selecting the More show another UIAlertController.

carouselCurrentItemIndexDidChange on iCarousel only being called when I swipe

I'm using iCarousel in my Swift+Sprite Kit game, where the user has unlocked and locked items.
The locked items would display some info like current user coins, and some text that says "UNLOCK THIS FOR: X amount of coins", if the carousel item isn't locked, it won't display any of that information, just a button that says "Select".
Now, I got that working, but it will only work when i start swiping the items and not the first time the carousel shows up.
To make that work, I do it inside carouselCurrentItemIndexDidChange() method. And that obviously changes when I swipe.
How can I set the current carousel index at start so then I can force to show or not show the information depending if the item is locked or unlocked and not only when I start swiping?
To add more information about this, imagine that the user selected the item at index 4, i save that index locally. So if the user closes and opens the game, the carousel should begin at 4 not 0.
Thanks in advance.
You should set up your carousel views in viewForItemAtIndex: reusingView:. The view returned by this method should represent the current state of that carousel item; so locked or "Select" as appropriate.
If the state of an item changes then you can call reloadItemAtIndex: to have iCarousel request an updated view for that item by calling viewForItemAtIndex: reusingView:.
You can scroll the carousel to a particular item by calling scrollToItemAtIndex:animated:

How to select just one row, prevent to unselect item in singleselect mode

My question is very simple but I really didn't find any solution here.
I have a Table setSelectable(true), setMultiselect(false), setImmediate(true).
It works fine by first click and moving through the table using arrows.
But if I click again to the row already having been selected,
then it becomes unselected. How to prevent it?
I'd like to have kept just one row always selected.
As from the Vaadin Book here:
If the user clicks on an already selected item, the selection will deselected and the table property will have null value. You can disable this behaviour by setting setNullSelectionAllowed(false) for the table.
So:
table.setNullSelectionAllowed(false);

iOS and SQL issue

I have an app that uses an SQLite database for user choices of backgrounds, icons, fonts, etc. I didn't create it, so, I have to use what I have, as, I have a rather large installed base, and am not inclined to switch to CoreData at this point. Don't want to piss off the current users. I also am not really up to speed on SQLite or CoreData.
I was using a custom grid view to display the backgrounds and icons. All of that has been changed to UICollectionView with a UICollectionViewCell.
In the SQL file, the base set is one table of 16 items. Really two (one for icons and the other for backgrounds). These are a part of the base app. In-app purchasing unlocks other "sets". These other sets are in a second table. Yes, separate tables for icons and backgrounds.
I have changed the ID numbers in the first table to start at 0. Previously they started at 1. I can now select and change both icons and backgrounds at will without issue and get the correctly selected item.
Except... when I select an item that is in the secondary icon or background table.
I have altered the ID numbers in the second table to start at one ID higher than the ending ID in the base set table.
But... the first item in the second table is being skipped. Selection of any item in the second table is showing the icon or background directly prior to the selected item. (ie. I select ID 21, I get ID 20 displayed). The first item in the secondary table is showing the last item in the secondary table.
So, my question... should the IDs in the second table start over at 0? Should they start at 1? Or is there another way to solve the skipping and incorrect selection?
Thanks in advance.

How do I move multiple nodes at once in a TJvTreeView?

When you select multiple nodes of a JvTreeView, and then try to drag these nodes, the JvTreeView selects the node you clicked to drag, rather than initiating dragging all the selected nodes. You end up dragging only this single node.
Is it possible to drag multiple nodes in a JvTreeView? I am using Delphi 2007.
UPDATE: Oddly enough, if I hold down CTRL+SHIFT when dragging the items, I can successfully drag them all. Any ideas?
Suppose MultiSelectStyle is the default [msControlSelect], then the answer to your question is 'you don't release the control key when you're selecting the last item and beginning dragging'.
The culprit is in TJvTreeView.WMLButtonDown in JvComCtrls.pas. Code there tests if 'Ctrl' is pressed when the TreeView is MultiSelect, and clears all items and selects the clicked item if 'Ctrl' is not pressed. It should instead test if the clicked item is already selected and do nothing if it is.
You can see the broken behavior without dragging. Multi select a few items and then click a selected item with the mouse. The VCL TreeView do not select or de-select anything, while the JVTreeView, instead, de-selects all items and selects the clicked one.
Yes absolutely, I do it all the time.
Of course Multi-Select needs to be True and you may need to have a look at the TTreeView's MultiSelectStyle. That controls what type of nodes can be selected at the same time. For example if msSiblingOnly is set to true, you can only select sibblings.
Are you using dmAutomatic or dmManual. If the latter, it could be that you are doing something in the OnMouse* events that is negating the multi-selection you made earlier.

Resources