Park
public struct Park : Decodable, Identifiable, Hashable
Park basics data includes location, contact, operating hours, and entrance fee/pass information for each national park. At least five photos of each park are also available.
-
Park identification string
Declaration
Swift
public let id: String
-
A variable width character code used to identify a specific park
Declaration
Swift
public let parkCode: String
-
Short park name (no designation)
Declaration
Swift
public let name: String
-
Full park name (with designation)
Declaration
Swift
public let fullName: String
-
Introductory paragraph from the park homepage
Declaration
Swift
public let description: String
-
Type of designation (eg, national park, national monument, national recreation area, etc)
Declaration
Swift
public let designation: ParkUnitDesignation
-
State(s) the park is located in
Declaration
Swift
public let states: [StateInUSA]
-
Park GPS cordinates
Declaration
Swift
public let gpsLocation: CLLocation?
-
General overview of how to get to the park
Declaration
Swift
public let directionsInfo: String
-
Link to page, if available, that provides additional detail on getting to the park
Declaration
Swift
public let directionsUrl: URL?
-
General description of the weather in the park over the course of a year
Declaration
Swift
public let weatherInfo: String?
-
Park Website
Declaration
Swift
public let url: URL?
-
Park images
Declaration
Swift
public let images: [NpsImage]?
-
Fee for entering the park
Declaration
Swift
public let entranceFees: [Fee]?
-
Passes available to provide entry into the park
Declaration
Swift
public let entrancePasses: [Fee]?
-
Park addresses (physical and mailing)
Declaration
Swift
public let addresses: [Address]?
-
Hours and seasons when the park is open or closed
Declaration
Swift
public let operatingHours: [OperatingHour]?
-
Information about contacting staff at the facility
Declaration
Swift
public let contacts: ContactInformation?
-
init(id:parkCode:name:fullName:description:designation:states:gpsLocation:directionsInfo:directionsUrl:weatherInfo:url:images:entranceFees:entrancePasses:addresses:operatingHours:contacts:)
Memberwise Initializer
Declaration
Swift
public init(id: String, parkCode: String, name: String, fullName: String, description: String, designation: ParkUnitDesignation, states: [StateInUSA], gpsLocation: CLLocation?, directionsInfo: String, directionsUrl: URL?, weatherInfo: String?, url: URL?, images: [NpsImage]?, entranceFees: [Fee]?, entrancePasses: [Fee]?, addresses: [Address]?, operatingHours: [OperatingHour]?, contacts: ContactInformation?)
-
Park can be compared for equality using the equal-to operator (
==
) or inequality using the not-equal-to operator (!=
)Declaration
Swift
public static func == (lhs: Park, rhs: Park) -> Bool
-
Park conforms to the Hashable protocol and hence can be used in a set or as a dictionary key
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Decoderwise Initializer
Declaration
Swift
public init(from decoder: Decoder) throws