Can I hide the rewind button in the iOS Lock Screen Music controls?
My app doesn’t support going back to previous tracks, and I’m wondering if I can tell the lock screen music controls to hide their rewind/previous track button. I use the
MPNowPlayingInfoCenter to communicate that information to the lock screen.
Pretty simple question, can it be done? For instance, to only show Play/Pause, and Skip Forward?
- How to implement network error alerts into my app?
- Putting a modal view over a view and making the background grey
- SpriteKit: How can I get the pixel color from a point in SKSpriteNode?
- How to create negative Firebase timestamp in swift
- Could not determine generated file paths for coreData code generation
- AVPlayer and MPMoviePlayerController differences
2 Solutions Collect From Internet About “Can I hide the rewind button in the iOS Lock Screen Music controls?”
As of iOS 7.1 there is a way to customize the controls available in the lock screen and command center (and probably many other accessories):
Regarding your question you can do the following:
[MPRemoteCommandCenter sharedCommandCenter].previousTrackCommand.enabled = NO; [MPRemoteCommandCenter sharedCommandCenter].skipBackwardCommand.enabled = NO; [MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand.enabled = NO; // You must also register for any other command in order to take control // of the command center, or else disabling other commands does not work. // For example: [MPRemoteCommandCenter sharedCommandCenter].playCommand.enabled = YES; [[MPRemoteCommandCenter sharedCommandCenter].playCommand addTarget:self action:@selector(play)];
Please see this Stack Overflow answer for more general information about MPRemoteCommandCenter.
I think the short answer is no. The documentation says this –
“You do not have direct control over which information is displayed, or its formatting. You set the values of the now playing info center dictionary according to the information you want to provide to the system. The system, or the connected accessory, handles the information’s display in a consistent manner for all apps.”
- Proper Realm usage patterns/best practices?
- UITableView: Handle cell selection in a mixed cell table view static and dynamic cells
- In Xcode 4, setting User Header Search path breaks code sense
- Perform action by clicking on some word in Uitextview or UILabel
- Cannot use a predicate that compares dates in Magical Record
- Make an iPhone specific app work on iPad to meet Apple requirements
- How to display my own map in MKMapView?
- How to build Cocoa Touch Framework for i386 and x86_64 architecture?
- Why does a previously working Xcode project hang up in Xcode 7 when presenting a new UITableviewController Subclass?
- Saving Variables on app exit
- Xcode 6.3.2 fails communicating with the Member Center
- What determines the presence of the iPhone Location Services icon in the status bar?
- How to solve CALayerInvalidGeometry', reason: 'CALayer position contains NaN: ?
- Objective C interfaces, delegates, and protocols
- Toggling UITextField to show and hide in Swift