Search code examples
iosobjective-cswiftmethodssignature

Translating method signatures from Objective-C to Swift


Currently I'm translating a class from Objective-C to apple Swift, but unfortunately I've no idea about Objective-C so any help in translating the signature of the following function from Objective-C to Swift?

- (void)playbackSession:(id<BCOVPlaybackSession>)session didReceiveLifecycleEvent:(BCOVPlaybackSessionLifecycleEvent *)lifecycleEvent

Solution

  • The signature in Swift would look like:

    func playbackSession(session: AnyObject<BCOVPlayBackSession>!, didReceiveLifecycleEvent event:BCOVPlaybackSessionLifecycleEvent!)