从iOS锁定屏幕在应用程序中自定义远程事件处理

spotify如何处理自定义远程事件?目前在运行iOS 8.1.3的iPhone 6和Spotify版本2.4.0.1822上,当我打开spotify无线电时,我在锁定屏幕上获得以下控件.我已经尝试阅读所有与远程事件有关的文档,我无法找到任何允许来自锁定屏幕的自定义远程事件的资源.

解决方法

也许这是通过MPRemoteCommandCenter实现的.
这是一个例子……
MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
[[remoteCommandCenter skipForwardCommand] addTarget:self action:@selector(skipForward)];
[[remoteCommandCenter togglePlayPauseCommand] addTarget:self action:@selector(togglePlayPause)];
[[remoteCommandCenter pauseCommand] addTarget:self action:@selector(pause)];
[[remoteCommandCenter likeCommand] addTarget:self action:@selector(like)];

实施此代码,在您的应用上播放音乐,并锁定您的iPhone.您可能会看到自定义锁定屏幕.

注意 – 菜单可以自定义标签,但不能自定义图标图像和行数.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...