Using Spotify Radio today and noticed that they have substituted a menu button for "<<" on the Control Center. When you press it you get the menu on the right. I've worked with Control Center before through the MPNowPlayingInfoCenter class, but there is no mention of this capability in the docs. Anyone know how they did it?
This is running on iOS7 so (in theory) it is not an Extension.
MPRemoteCommandCenter is what you need. You can set the dislikeCommand, likeCommand and bookmarkCommand properties to perform the actions you need, and override the localizedTitle properties of those commands to change the text. Unfortunately, as can be seen in the screenshot, you can't customise the icons of the commands.
Related
I have members complaining that they are unable to tap certain buttons located in a custom navigation bar at the top of my iOS app. The common complaint is that when they do attempt to tap, they see UI that looks like this:
This is about a 200x200 pixel square that appears over the middle of the screen.
We have no code in our app that is capable of drawing that kind of UI. I can only assume this is being triggered by some kind of iOS UI or Usability setting. The only thing I can think of is that we also have a UITabBarController, and the user (in this case) happens to be on the "Browse" tab of my app. If possible, I would like to either a) programmatically disable this or b) inform the user how he can manually disable this UI via an iOS setting someplace.
Can anyone identify what might trigger the UI you see above?
It is a new feature of iOS 11. Take a look at Bar Item Images.
To disable this you should remove an image from Accessibility on Bar Item (see link). But I am not sure how (or even whether) you can define that a user has enabled large content text.
For more info take a look at What's New in Accessibility.
I'd like to remove my apps Today Widget from appearing when 3D touching the app icon on the home screen because showing the quick actions and the Today Widget just doubles up the actions app provides (seen in screenshot). Is there anyway to hide widgets from the 3D touch quick actions using the Info.plist or some other method?
Thanks
So, if you have multiple homescreen widgets, you can set UIApplicationShortcutWidget to determine which one should be shown. I haven't been able to find a way to disable them altogether from appearing in the 3d touch shortcut menu.
One option you may be able to try (this works for me on the simulator) is to set this value in your Info.plist to the value of nil.
<key>UIApplicationShortcutWidget</key>
<string>nil</string>
Your other option is to create a different widget, with more useful functionality, perhaps such as showing the currently running timer, or other stats.
Apple released this has a new feature, where user can see the handy information when force touching the App icon for shortcut items. I presume we cannot remove widget during 3D touch quick actions.
Unfortunately, there's now way to hide app widget. If you set UIApplicationShortcutWidget to nil, your app will get rejected.
I am trying to have a button, in a toolbar, use a system icon, by modifying its appearance in the XCode 7 interface builder. If I do this at the toolbar item level, then this just becomes a regular UIButtonBarItem, removing the button underneath. This means it won't send any press items, from what I can see.
I don't see a way on the UIButton, in the interface builder, to specify a system icon. Ideally I would like to avoid having to do this programmatically. Can anyone suggested a way?
Note, Apple indicates:
iOS provides a lot of small icons—representing common tasks and types
of content—for use in tab bars, toolbars, navigation bars, and Home
screen quick actions. It’s a good idea to use the built-in icons as
much as possible because users already know what they mean.
Unfortunately it is not clear how to leverage them? Some sources indicate using "iOS-Artwork-Extractor", but I would hope there is another way to address this, maybe via some API call?
XCode 7.2.1, targeting iOS.
For the UIButtonBarItem and the subset of icons available there (see table 41-1 in the iOS Human Interface Guidelines), to have it notify the code that it was pressed, then it is simply a question of adding an 'IBAction' function to the class corresponding to the view, for example (Swift):
#IBAction func flashItemActioned (sender: UIButton) {
//
}
and then linking the "sent actions" of the item with the function in the first responder.
For UIButton based implementations I haven't found a solution beyond the "iOS-Artwork-Extractor".
I'm working with the new interactive notifications in iOS 8; it fails to get the action buttons (in "banner mode") to show up by default. As it is now I have to slide down on top of the notification to see them.
Is this the default behavior, or is my code rotten?
For the images below I am using XCode 6.1.1 + iOS 8.1 (Simulator)
What I get:
What I want:
This is the default behaviour and no problem with your code.
For more details refer to the below tutorial, result is same as yours.
http://www.thinkandbuild.it/interactive-notifications-with-notification-actions/
Its a default behaviour. Don't worry about this. Apple says:
When a notification is delivered, the system displays a button for each custom action associated with the notification. Tapping a button launches your app (either in the foreground or background) and gives you a chance to perform the indicated action. You use this class to specify the text that is displayed in the button and the information your app needs to perform the corresponding action.
The options are not default behaviour. That can be done via - UIUserNotificationCategory
Refer this WWDC video - https://developer.apple.com/videos/wwdc/2014/?include=713
It's pretty straight forward and easy to implement. Let me know if you face any issues.
Everything is behaving normally. All that needs to be done is to drag down the bottom horizontal bar in the banner and the action buttons would be visible in the banner.
PS - As of iOS8. Once iOS9 comes in in a few more days, no guarantees if this is how it will still be.
Generally I look at Apple's UICatalog sample code for basic VoiceOver support however it looks like there is VoiceOver support for UIPickerViews in the sample code. Do I need to provide an accessibilityLabel method somewhere to add VoiceOver support? I tried to implement UIPickerViewAccessibilityDelegate methods but voice over only reads the labels in my picker view and not the hint to swipe up or down to change the values.
Also my picker view is set to the input view of a UITextField. So I'm not sure if that is relevant or not.
Update:
https://github.com/stevemoser/VoiceOverPicker
I created a sample project demonstrating the issue. In the example there is a normal picker view shown and a textfield. There is also a picker that is set to the textfield's input view property. I can't seem to activate the either picker just by tapping on it while using VoiceOver. Though I can activate either one by swiping (left and right) through the views on screen. Any ideas?
Update 2:
Looks like if the app is an iPhone app running on an iPhone or an iPad app running on an iPad it works fine but if it is an iPhone only app running on an iPad, tapping to select a UIPickerView doesn't work.
Are you just doing a vanilla UIPickerView using titles for each row (and not custom views)? If so, there isn't anything that you should have to do.
You mentioned that VoiceOver was correctly reading the label on each row, so we know that the UIPickerView correctly has isAccessibilityElement set to YES. It's also correctly reading the accessibilityLabels.
Is it possible that you're interacting with the picker before it has a chance to read the accessibilityHint? (For the benefit of others, the accessibilityHint is the "swipe or down with one finger to adjust the value" that Steve mentioned in his question.) Or perhaps some notification is changing the VoiceOver focus before the hint has a chance to be read?
By default, if your picker view is accessible, when you focus on it with VoiceOver it will read the something along these lines:
"[ROW LABEL] Adjustable [#number] out of [#total] picker item" a 2 to
3 second pause then "Swipe up or down to select value"
A few of things to note:
There is a 2 to 3 second delay between reading the label and the hint, make sure you wait for it.
If you're providing your own hint, the default one will not get read I believe
Hints are only read when you reach a certain control by either directly pressing it or by swiping right or left to the control. it will not get read if you do a 2 finger swipe down or up.
Make sure you're testing on an actual device and not a simulator as it does not show all of the things VoiceOver announces.