Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift sort list true before false

// In-place:
array.sort { $0.selected && !$1.selected }

// To a new array:
array.sorted { $0.selected && !$1.selected }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #sort #list #true #false
ADD COMMENT
Topic
Name
8+4 =