【发布时间】:2017-05-26 15:48:45
【问题描述】:
如何设置 MPRemoteCommandCenter/MPNowPlayingInfoCenter 来添加搜索按钮?我想要实现的结果在屏幕截图上。 我已经添加了这段代码:
[[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
[weakSelf rewindForward];
return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand.enabled = YES;
[[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
[weakSelf rewindBackward];
return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekBackwardCommand.enabled = YES;
【问题讨论】:
标签: ios objective-c mpnowplayinginfocenter