Add indexOfObject:inSortedRange:options:usingComparator: method in Swift Array

Originator:fromcelticpark
Number:rdar://22098225 Date Originated:01-Aug-2015
Status:Closed (Duplicate) Resolved:
Product:Swift Product Version:Swift 1.2
Classification:Feature (New) Reproducible:Not Applicable
 
Although NSArray and NSOrderedSet have method indexOfObject:inSortedRange:options:usingComparator:, there is no such method in Swift Array.

By now there are two options to bypass this problem:
1) Implement your own binary search method. You can find more on this here http://stackoverflow.com/a/26679191/1722840. 
2) Bridge Swift Array to NSArray and use Foundation method. Though such bridging may be slow (described here: http://swiftdoc.org/swift-2/type/Array/)

Considering all the available options it would be only natural to have such method in Swift.

Comments

Duplicate of 17743336 (Open)

20-Aug-2015 08:04 PM

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.

If you have any questions or concerns, please update your report directly here: http://bugreport.apple.com/.

By fromcelticpark at Aug. 31, 2015, 12:15 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!