mgrs-ios 1.1.6 Documentation

Class Line

open class Line: SFLine  
  • Line between two points
Line Line SFLine SFLine Line->SFLine MGRSLine MGRSLine MGRSLine->Line

Subclasses

MGRSLine

Conforms To

SFLine

Initializers

init(_:​_:​)

public init(_ point1: GridPoint, _ point2: GridPoint)  
  • Initialize
  • @param point1
  •        first point
    
  • @param point2
  •        second point
    

init(_:​)

public init(_ line: Line)  
  • Initialize
  • @param line
  •        line to copy
    

init?(coder:​)

public required init?(coder: NSCoder)  

Properties

point1

public var point1: GridPoint  
  • The first point

point2

public var point2: GridPoint  
  • The second point

unit

public var unit: Unit  
  • The unit

hash

open override var hash: Int  

Methods

set​Points(_:​_:​)

public func setPoints(_ point1: GridPoint, _ point2: GridPoint)  
  • Set the points
  • @param point1
  •        first point
    
  • @param point2
  •        second point
    

is​Unit(_:​)

public func isUnit(_ unit: Unit) -> Bool  
  • Is in the provided unit type
  • @param unit
  •        unit
    
  • @return true if in the unit

is​Degrees()

public func isDegrees() -> Bool  
  • Is this line in degrees
  • @return true if degrees

is​Meters()

public func isMeters() -> Bool  
  • Is this line in meters
  • @return true if meters

to​Unit(_:​)

public func toUnit(_ unit: Unit) -> Line  
  • Convert to the unit
  • @param unit
  •        unit
    
  • @return line in units, same line if equal units

to​Degrees()

public func toDegrees() -> Line  
  • Convert to degrees
  • @return line in degrees, same line if already in degrees

to​Meters()

public func toMeters() -> Line  
  • Convert to meters
  • @return line in meters, same line if already in meters

intersection(_:​)

public func intersection(_ line: Line) -> GridPoint?  
  • Get the intersection between this line and the provided line
  • @param line
  •        line
    
  • @return intersection

mutable​Copy(with:​)

open override func mutableCopy(with zone: NSZone? = nil) -> Any  

encode(with:​)

open override func encode(with coder: NSCoder)  

is​Equal(_:​)

public func isEqual(_ line: Line?) -> Bool  

is​Equal(_:​)

open override func isEqual(_ object: Any?) -> Bool