在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Starting from Swift 4.1, all you have to is to conform to the Example:
At this point, the equality would be based on the
https://stackoverflow.com/questions/37541512/swift-struct-doesnt-conform-to-protocol-equatable
猜测:下面两者的签名形式应该是相同的
/// Represents a response to a `MoyaProvider.request`. public final class Response: CustomDebugStringConvertible, Equatable { public static func == (lhs: Response, rhs: Response) -> Bool { return lhs.statusCode == rhs.statusCode && lhs.data == rhs.data && lhs.response == rhs.response } }
public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { // pointer equality guard lhs !== rhs else { return true }
// must both have valid targets and identical attributes guard let target1 = lhs.target, let target2 = rhs.target, target1 === target2 && lhs.attributes == rhs.attributes else { return false }
return true }
|
请发表评论