I have just downloaded Xcode6-beta6. I am getting compiler error "ambiguous use of operator ‘>‘" for following codes
reversed = sorted(names, { s1, s2 in s1 > s2 } )
It was working before in Xcode6-beta5.
The code is from apple swift documentationhttps://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-XID_152
Any ideas?
names
defined as? – Mike S Aug 23 ‘14 at 4:51names
? I just tried it successfully in a playground with the following code:let names = ["a", "b"]; let reversed = sorted(names, { s1, s2 in s1 > s2 } )
– Gary Makin Aug 23 ‘14 at 5:20var arrayToSort = ["a", "b"]; arrayToSort.sort{ $0 > $1 }
. If I change the operator to less than (<
) the error disappears. – wottpal Aug 23 ‘14 at 22:25