startIndex
TypeScriptget startIndex(): numberSwift declarationvar startIndex: Int { get }The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.
struct · iOS 16.0+ · SDK 27.1
struct DateBinsA collection of bins for a chart that plots data against dates.
get startIndex(): numberSwift declarationvar startIndex: Int { get }The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.
static initThresholds(thresholds: Array<globalThis.Date>): DateBinsSwift declarationnonisolated init(thresholds: [Date])Creates N-1 bins with the given N `thresholds`. - Parameter thresholds: The threshold values that surround the bins. - Returns: The bins.
get thresholds(): Array<globalThis.Date>Swift declarationvar thresholds: [Date] { get }Find the bin thresholds. - Returns: The bin thresholds that surround the bins.
static initTimeIntervalRange(timeInterval: number, range: SDKHandle): DateBinsSwift declarationnonisolated init(timeInterval: TimeInterval, range: ClosedRange<Date>)Creates uniform bins covering the given range. The first bin starts at the lower bound of the range. - Parameter timeInterval: The size of the bins. - Parameter range: The range of the data the bins cover. - Returns: The bins.
static initDataDesiredCountCalendar(data: Array<globalThis.Date>, desiredCount?: (number) | null, calendar?: _Foundation_Calendar): DateBinsSwift declarationnonisolated init(data: [Date], desiredCount: Int? = nil, calendar: Calendar = .autoupdatingCurrent)Automatically determine the bins from data. - Parameter data: The given data values. - Parameter desiredCount: The desired number of bins for the given data. If `nil`, infer the number of bins automatically from data using [Scott's normal reference rule](https://doi.org/10.1093/biomet/66.3.605) capped at 200. - Returns: The inferred bins.
static initUnitByRangeCalendar(unit: _Foundation_Calendar_Component, stride: number, range: SDKHandle, calendar?: _Foundation_Calendar): DateBinsSwift declarationnonisolated init(unit: Calendar.Component, by stride: Int = 1, range: ClosedRange<Date>, calendar: Calendar = .autoupdatingCurrent)Creates uniform bins covering the given range. - Parameter unit: The size of the bins. - Parameter stride: The number of components for each bin. - Parameter range: The range of the data the bins cover. - Parameter calendar: The calendar to use. - Returns: The bins.
indexFor(value: globalThis.Date): numberSwift declarationfunc index(for value: Date) -> IntReturns the bin index for the given value. - Parameter value: The date value to get the index for. - Returns: The bin index.
indexAfter(i: number): numberSwift declarationfunc index(after i: Int) -> IntReturns the position immediately after the given index. The successor of an index must be well defined. For an index `i` into a collection `c`, calling `c.index(after: i)` returns the same index every time. - Parameter i: A valid index of the collection. `i` must be less than `endIndex`. - Returns: The index value immediately after `i`.
static initRangeDesiredCountCalendar(range: SDKHandle, desiredCount?: number, calendar?: _Foundation_Calendar): DateBinsSwift declarationnonisolated init(range: ClosedRange<Date>, desiredCount: Int = 10, calendar: Calendar = .autoupdatingCurrent)Automatically determine the bins from a range of data. - Parameter range: The range the bins should cover. - Parameter desiredCount: The desired number of bins for the given data. - Returns: The inferred bins.
get endIndex(): numberSwift declarationvar endIndex: Int { get }The collection's "past the end" position---that is, the position one greater than the last valid subscript argument. When you need a range that includes the last element of a collection, use the half-open range operator (`..<`) with `endIndex`. The `..<` operator creates a range that doesn't include the upper bound, so it's always safe to use with `endIndex`. For example: let numbers = [10, 20, 30, 40, 50] if let index = numbers.firstIndex(of: 30) { print(numbers[index ..< numbers.endIndex]) } // Prints "[30, 40, 50]" If the collection is empty, `endIndex` is equal to `startIndex`.
subscript(position: number): ChartBinRange<globalThis.Date>Swift declarationsubscript(position: Int) -> ChartBinRange<Date> { get }Accesses the element at the specified position. The following example accesses an element of an array through its subscript to print its value: var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] print(streets[1]) // Prints "Bryant" You can subscript a collection with any valid index other than the collection's end index. The end index refers to the position one past the last element of a collection, so it doesn't correspond with an element. - Parameter position: The position of the element to access. `position` must be a valid index of the collection that is not equal to the `endIndex` property. - Complexity: O(1)
No declarations were skipped in this snapshot.