     
     func peerConnection(_ nativePeerConnection: RTCPeerConnection,
                         didChange newState: RTCIceGatheringState) {
-        let newState = ICEGatheringState(nativeValue: newState)
         Logger.debug(type: .peerChannel,
                      message: "changed ICE gathering state to \(newState)")
         internalState.iceGatheringState = newState

    var onCompleteHandler: (() -> Void)?
    var onDisconnectHandler: (() -> Void)?
    
    init(signalingState: PeerChannelSignalingState,
         iceConnectionState: ICEConnectionState,
         iceGatheringState: ICEGatheringState) {
        self.signalingState = signalingState
        self.iceConnectionState = iceConnectionState
        self.iceGatheringState = iceGatheringState

import Foundation
import WebRTC

class PeerChannelInternalState {
    
    var signalingState: RTCSignalingState {
        didSet { validate() }
    }
    
    var iceConnectionState: RTCIceConnectionState {
        didSet { validate() }
    }
    
    var iceGatheringState: RTCIceGatheringState {
        didSet { validate() }
    }
    
