Swift 4: var running error
marc-medley opened this issue · 2 comments
marc-medley commented
FYI: Swift 4 produces a compile time error for
var running: Bool { @objc(isRunning) get }
ERROR: Unavailable var 'running' was used to satisfy a requirement of protocol 'SBApplicationProtocol'
Here is one possible alternative that compiles and runs OK for me in Xcode 9, Swift 4 beta 6:
@objc optional var isRunning: Bool { get }
Here's another alternative, without using @objc optional
, which is also currently running OK for me on macOS 10.12, Xcode 9 beta 6, Swift 4:
@objc
public protocol SBApplicationProtocol: SBObjectProtocol {
func activate()
var delegate: SBApplicationDelegate! { get set }
var isRunning: Bool { get }
}
tingraldi commented
@marc-medley Thanks for the heads-up. I've yet to look at a Swift 4 update to SwiftScripting. I'll keep this in mind.
tingraldi commented
I just pushed an update for Swift 4. Please give it a try and see if it resolves this issue.