What is the best way to convert this objective-c sorting method?
let visibleViews = self.scrollView.visibleViews().sorted(by: {$0.frame.origin.x > $1.frame.origin.x} ) I convert to :
[visibleViews sortUsingComparator:^NSComparisonResult(UIView *obj1, UIView *obj2) { return obj1.frame.origin.x > obj2.frame.origin.x; }]; I want to sort values to put the view with the larger xOrigin first (so the first item in the array will be the view on the right side of the screen). But I don't get the expected result.
>operator does not give the requiredNSComparisonResultresult.