public class EQ:NSObject
{
}
extension EQ: Comparable {}
public func ==(lhs: EQ,rhs: EQ) -> Bool
{
return true
}
public func <(lhs: EQ,rhs: EQ) -> Bool
{
return true
}
public func <=(lhs: EQ,rhs: EQ) -> Bool
{
return true
}
public func >=(lhs: EQ,rhs: EQ) -> Bool
{
return true
}
public func >(lhs: EQ,rhs: EQ) -> Bool
{
return true
}
用法:
let eq1 = EQ()
let eq2 = EQ()
print(eq1 > eq2)
原文链接:/swift/325419.html