Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use closure syntax for weak and unowned vars. #160

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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