I'm trying to get some github code to function in Swift 4.1 and Xcode 9.3, but cannot. Presumably the code ran in an earlier version of Swift. It appears the offending code is as follows:
extension GKComponentSystem
{
func getGKAgent2D() -> [GKAgent2D]
{
return components
.filter({ $0 is GKAgent2D })
.map({ $0 as! GKAgent2D })
}
}
When I try to run in simulator for iPhone 8 I get the following error message:
Extension of a generic objective-c class cannot access the class's generic parameters at runtime.
I've done some searching and one source claimed that addition @objc func.... should fix the issue. It does not. I am at a loss. Can anyone give any insight to how to fix the problem? Thanks in advance.