目前我正在将一个类从Objective-C翻译成苹果Swift,但不幸的是我对Objective-C一无所知,所以在将以下函数的签名从Objective-C转换为Swift时有任何帮助?
- (void)playbackSession:(id<BCOVPlaybackSession>)session didReceiveLifecycleEvent:(BCOVPlaybackSessionLifecycleEvent *)lifecycleEvent
答案 0 :(得分:2)
Swift中的签名如下:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// your code
return true;
}
return super.onKeyDown(keyCode, event);
}
答案 1 :(得分:0)