Using CocoaPods 1.4.0 I set the swift-version in my .podspec file to 4 liek so:
s.swift_version = '4.0'
When compiling, I get the following warning:
- WARN | xcodebuild: Starscream/Sources/WebSocket.swift:125:5: warning: 'weak' should not be applied to a property declaration in a protocol and will be disallowed in future versions
this refers to the WSStream protocol:
public protocol WSStream {
weak var delegate: WSStreamDelegate? {get set}
....
}
See this discussion on Stack Overflow about this kind of issue:
How are you getting this warning? I haven't seen this in Xcode Version 9.2 (9C40b), with the compiler set to Swift 4.0. Does anyone else receive this warning?
Am getting the same warning from line:
125 weak var delegate: WSStreamDelegate? {get set} //'weak' should not be applied to a property declaration in a protocol and will be disallowed in future versions
Running Swift 4.0 on Xcode Version 9.3 beta (9Q98q)
The same warning at the same line (Xcode 9.3)
Version 3.0.5 has been released. It removed the weak and should fix this warning.
https://github.com/apple/swift-evolution/blob/master/proposals/0186-remove-ownership-keyword-support-in-protocols.md
Most helpful comment
Am getting the same warning from line:
125 weak var delegate: WSStreamDelegate? {get set} //'weak' should not be applied to a property declaration in a protocol and will be disallowed in future versions
Running Swift 4.0 on Xcode Version 9.3 beta (9Q98q)