似乎当我在播放某些东西(模拟器或设备)时在控制中心上按“下一个”时,nextTrackCommand
和seekForwardCommand
都被调用。
这两个功能都已启用,但是只要轻按“下一步”按钮就不会调用这两个功能。
更多代码:
[MPRemoteCommandCenter sharedCommandCenter].playCommand.enabled = YES;
[[MPRemoteCommandCenter sharedCommandCenter].playCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
return MPRemoteCommandHandlerStatusSuccess;
}];
[[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
NSLog(@"nextTrackCommand");
return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand.enabled = YES;
[[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent * _Nonnull event) {
NSLog(@"seekForwardCommand");
return MPRemoteCommandHandlerStatusSuccess;
}];
[MPRemoteCommandCenter sharedCommandCenter].seekForwardCommand.enabled = YES;
我已将波纹管链接到一个演示此问题的示例项目。
https://docs.mongodb.com/manual/reference/operator/projection/elemMatch/