List
List<T> is the container type in Realm used to define to-many relationships.
Lists hold a single Object subclass (T) which defines the type
of the list.
Lists can be filtered and sorted with the same predicates as Results<T>.
When added as a property on Object models, the property must be declared as let and cannot be dynamic.
-
Returns a
GeneratorOf<T>that yields successive elements in the list.Declaration
Swift
public func generate() -> RLMGenerator<T>
-
Replace the given
subRangeof elements withnewElements.Declaration
Swift
public func replaceRange<C: CollectionType where C.Generator.Element == T>(subRange: Range<Int>, with newElements: C)Parameters
subRangeThe range of elements to be replaced.
newElementsThe new elements to be inserted into the list.
-
The position of the first element in a non-empty collection. Identical to endIndex in an empty collection.
Declaration
Swift
public var startIndex: Int { return 0 } -
The collection’s
past the end
position. endIndex is not a valid argument to subscript, and is always reachable from startIndex by zero or more applications of successor().Declaration
Swift
public var endIndex: Int { return count }
View on GitHub
Install in Dash
List Extension Reference