ZoomRange
public struct ZoomRange : Sequence
A range of zooms. Matematically: [z1, z1+1, z1+2,…, z2-1, z2]
For instance: z1 = 2, z2 = 5 then [2, 3, 4, 5] would be the range.
Usage example:
let zR = ZoomRange(2,5).toArray()
print(zR.count) // => 4
It strictly stores z1 and z2, and the rest of the range is built upon request.
-
Minimum zoom in this range.
Declaration
Swift
public let min: Zoom
-
Maximum zoom in this range.
Declaration
Swift
public let max: Zoom
-
Difference between max zoom and min zoom.
Declaration
Swift
var diffZoom: Zoom { get }
-
Number of zooms in this range
Example:
let zR = ZoomRange(2,2) print(zR.count) // => 1
Declaration
Swift
public var count: Zoom { get }
-
Converts the zoom range in to an array
.
Declaration
Swift
func toArray() -> [Zoom]
-
Returns the iterator for this range. It allows to use
ZoomRange
in for loops.See also
IteratorProtocolDeclaration
Swift
public func makeIterator() -> ZoomRangeIterator