Starscream: Swift 4 issue

Created on 27 Feb 2018  路  4Comments  路  Source: daltoniam/Starscream

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:

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)

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xjimi picture xjimi  路  4Comments

LondonAtlas picture LondonAtlas  路  3Comments

lveselovsky picture lveselovsky  路  3Comments

haducloc picture haducloc  路  3Comments

marknorgren picture marknorgren  路  5Comments