Skip to content

Commit

Permalink
Use closure syntax for weak and unowned vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
oNaiPs committed Apr 14, 2016
1 parent 02a8b82 commit 4a4ffd6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 68 deletions.
12 changes: 6 additions & 6 deletions src/PluginRTCPeerConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
let sdp = desc.objectForKey("sdp") as? String ?? ""
let rtcSessionDescription = RTCSessionDescription(type: type, sdp: sdp)

self.onSetDescriptionSuccessCallback = { () -> Void in
self.onSetDescriptionSuccessCallback = { [unowned self] () -> Void in
NSLog("PluginRTCPeerConnection#setLocalDescription() | success callback")

let data = [
Expand Down Expand Up @@ -175,7 +175,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
let sdp = desc.objectForKey("sdp") as? String ?? ""
let rtcSessionDescription = RTCSessionDescription(type: type, sdp: sdp)

self.onSetDescriptionSuccessCallback = { () -> Void in
self.onSetDescriptionSuccessCallback = { [unowned self] () -> Void in
NSLog("PluginRTCPeerConnection#setRemoteDescription() | success callback")

let data = [
Expand Down Expand Up @@ -300,7 +300,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
) {
NSLog("PluginRTCPeerConnection#RTCDataChannel_setListener()")

weak var pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]
let pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]

if pluginRTCDataChannel == nil {
return;
Expand Down Expand Up @@ -335,7 +335,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
return
}

weak var pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]
let pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]

if pluginRTCDataChannel == nil {
return;
Expand All @@ -356,7 +356,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
return
}

weak var pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]
let pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]

if pluginRTCDataChannel == nil {
return;
Expand All @@ -373,7 +373,7 @@ class PluginRTCPeerConnection : NSObject, RTCPeerConnectionDelegate, RTCSessionD
return
}

weak var pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]
let pluginRTCDataChannel = self.pluginRTCDataChannels[dcId]

if pluginRTCDataChannel == nil {
return;
Expand Down
Loading

0 comments on commit 4a4ffd6

Please sign in to comment.