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.

  • min

    Minimum zoom in this range.

    Declaration

    Swift

    public let min: Zoom
  • max

    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 }
  • Creates the range of zooms.

    Declaration

    Swift

    public init?(_ z1: Zoom, _ z2: Zoom)
  • 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

    IteratorProtocol

    Declaration

    Swift

    public func makeIterator() -> ZoomRangeIterator