SwiftSortedList alternatives and similar libraries
Based on the "Data Structures / Algorithms" category.
Alternatively, view SwiftSortedList alternatives based on common mentions on social networks and blogs.
-
KeyPathKit
KeyPathKit is a library that provides the standard functions to manipulate data along with a call-syntax that relies on typed keypaths to make the call sites as short and clean as possible. -
BinaryKit
💾🔍🧮 BinaryKit helps you to break down binary data into bits and bytes, easily access specific parts and write data to binary. -
RandMyMod
RandMyMod base on your own struct or class create one or a set of instance, which the variable's value in the instance is automatic randomized. -
OneWaySynchronizer
The simplest abstraction to synchronize local data with remote source. For iOS, wirtten in swift.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SwiftSortedList or a related project?
README
SwiftSortedList
Usage
All you need is a Comparable object:
import SwiftSortedList
struct MyObj : Comparable {
var id: Int
}
func ==(x: MyObj, y: MyObj) -> Bool {
return x.id == y.id
}
func <(x: MyObj, y: MyObj) -> Bool {
return x.id < y.id
}
Then you can use the SortedList:
// create a new sorted list
var sl = SortedList<MyObj>()
// add an object
let mo = MyObj(id: 1)
sl.addElement(mo)
// get an object
let mo2 = sl.getAt(0)
let mo2s = sl[0]
print(mo2 == mo2s)
// helpers functions
let size: Int = sl.count
let elements: [MyObj] = sl.array
// remove an object
sl.removeElement(mo)
// replace an object
let mo3 = MyObj(id: 3)
sl.replace(at: 0, with: mo3)
print(mo2 == sl[0]) // false
print(mo3 == sl[0]) // true
// loop
for el in sl.array {
// do something with el
}
Installation
SwiftSortedList is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SwiftSortedList"
Author
License
SwiftSortedList is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the SwiftSortedList README section above
are relevant to that project's source code only.