Actualice el marco de "Reproductor" para ios a Swift 3

Estoy trabajando en una aplicación que utiliza el marco "Jugador" mediante https://github.com/piemonte Desde que actualicé a swift 3, obtengo errores con respecto a una function específica. No estoy realmente seguro de cómo solucionarlo ya que no soy un profesional en swift 3 todavía. ¿Alguna ayuda? :RE

el código (swift 2.3) (por favor ayúdenme a actualizarlo a swift 3)

private var PlayerObserverContext = 0 private var PlayerItemObserverContext = 0 private var PlayerLayerObserverContext = 0 override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { switch (keyPath, context) { case (.some(PlayerRateKey), PlayerObserverContext): true case (.some(PlayerStatusKey), PlayerItemObserverContext): true case (.some(PlayerKeepUp), PlayerItemObserverContext): if let item = self.playerItem { self.bufferingState = .ready self.delegate?.playerBufferingStateDidChange(self) if item.isPlaybackLikelyToKeepUp && self.playbackState == .playing { self.playFromCurrentTime() } } let status = (change?[NSKeyValueChangeKey.newKey] as! NSNumber).intValue as AVPlayerStatus.RawValue switch (status) { case AVPlayerStatus.readyToPlay.rawValue: self.playerView.playerLayer.player = self.player self.playerView.playerLayer.isHidden = false case AVPlayerStatus.failed.rawValue: self.playbackState = PlaybackState.failed self.delegate?.playerPlaybackStateDidChange(self) default: true } case (.some(PlayerEmptyBufferKey), PlayerItemObserverContext): if let item = self.playerItem { if item.isPlaybackBufferEmpty { self.bufferingState = .delayed self.delegate?.playerBufferingStateDidChange(self) } } let status = (change?[NSKeyValueChangeKey.newKey] as! NSNumber).intValue as AVPlayerStatus.RawValue switch (status) { case AVPlayerStatus.readyToPlay.rawValue: self.playerView.playerLayer.player = self.player self.playerView.playerLayer.isHidden = false case AVPlayerStatus.failed.rawValue: self.playbackState = PlaybackState.failed self.delegate?.playerPlaybackStateDidChange(self) default: true } case (.some(PlayerReadyForDisplay), PlayerLayerObserverContext): if self.playerView.playerLayer.isReadyForDisplay { self.delegate?.playerReady(self) } default: super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) } } 

errores

Desenvolvería el context con una instrucción guard y coincidiría así:

 override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { guard let context = context else { return } switch (keyPath, context) { case (.some(PlayerRateKey), &PlayerObserverContext): break case (.some(PlayerStatusKey), &PlayerItemObserverContext): break case (.some(PlayerKeepUpKey), &PlayerItemObserverContext): break // etc } } 

Eso debería comstackr y ejecutarse.

También convertiría los true en break . No estoy seguro para qué fueron las true .