├── CSV.framework ├── .gitignore ├── GTFSKit.framework ├── Gemfile ├── docs ├── img │ ├── gh.png │ ├── carat.png │ └── dash.png ├── docsets │ ├── NYMTAKit.tgz │ └── NYMTAKit.docset │ │ └── Contents │ │ ├── Resources │ │ ├── docSet.dsidx │ │ └── Documents │ │ │ ├── img │ │ │ ├── gh.png │ │ │ ├── carat.png │ │ │ └── dash.png │ │ │ ├── js │ │ │ └── jazzy.js │ │ │ ├── css │ │ │ ├── highlight.css │ │ │ └── jazzy.css │ │ │ ├── index.html │ │ │ ├── Typealiases.html │ │ │ ├── Extensions.html │ │ │ ├── Classes │ │ │ ├── Stations.html │ │ │ ├── Colors.html │ │ │ └── UnableToFindDataAssetError.html │ │ │ ├── Structs │ │ │ └── Complex.html │ │ │ └── Extensions │ │ │ └── Array.html │ │ └── Info.plist ├── undocumented.json ├── badge.svg ├── js │ └── jazzy.js ├── css │ ├── highlight.css │ └── jazzy.css ├── index.html ├── Typealiases.html ├── Extensions.html ├── Classes │ ├── Stations.html │ ├── Colors.html │ └── UnableToFindDataAssetError.html ├── Structs │ └── Complex.html └── Extensions │ └── Array.html ├── Cartfile ├── .jazzy.yaml ├── Cartfile.resolved ├── NYMTAKit.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── NYMTAKit-iOS.xcscheme │ └── NYMTAKit-macOS.xcscheme ├── Types ├── DaytimeRoute.swift ├── Complex.swift ├── Errors.swift ├── Station.swift ├── Color.swift └── Entrance.swift ├── DataSources ├── Complexes.swift ├── Entrances.swift ├── Stations.swift ├── Colors.swift └── DataSource.swift ├── NYMTAKit ├── NYMTAKit.h └── Info.plist ├── NYMTAKitTests ├── ComplexesTest.swift ├── EntrancesTest.swift ├── StationsTest.swift ├── ColorsTest.swift ├── Info.plist ├── Test Data │ ├── MTA - StationComplexes.csv │ └── MTA - colors.fixed.csv └── Shared.swift ├── Utility └── Array.swift ├── README.md └── Gemfile.lock /CSV.framework: -------------------------------------------------------------------------------- 1 | Carthage/Build/Mac/CSV.framework -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata 2 | /Carthage 3 | /build 4 | -------------------------------------------------------------------------------- /GTFSKit.framework: -------------------------------------------------------------------------------- 1 | Carthage/Build/Mac/GTFSKit.framework -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'jazzy' -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/img/gh.png -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/docsets/NYMTAKit.tgz -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/ian/Documents/Adorkable/NYMTAKit/repo" 6 | } -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "adorkable-forkable/GTFSKit" "master" 2 | 3 | github "SeRG1k17/UIColor-Hex-Swift" "master" 4 | 5 | github "adorkable-forkable/CSV.swift" "master" 6 | -------------------------------------------------------------------------------- /.jazzy.yaml: -------------------------------------------------------------------------------- 1 | clean: true 2 | author: Ian Grossberg 3 | author_url: https://www.iangrossberg.com 4 | github_url: https://github.com/Adorkable/NYMTAKit 5 | module: NYMTAKit 6 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/docsets/NYMTAKit.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "SeRG1k17/UIColor-Hex-Swift" "3a65da534b71b3e6909f6ada6bfdd3b80ee43ca8" 2 | github "adorkable-forkable/GTFSKit" "caecb4887444aad914b195642a75d4b6a68d1cc2" 3 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Adorkable/NYMTAKit/master/docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /NYMTAKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NYMTAKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Types/DaytimeRoute.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DaytimeRoute.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // Eventually potentially a more appropriate type, maybe an enum or self managed type 12 | /// Daytime Route ID 13 | public typealias DaytimeRoute = String 14 | -------------------------------------------------------------------------------- /DataSources/Complexes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Complexes.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // TODO: support original CSVs 12 | 13 | // Based on http://web.mta.info/developers/data/nyct/subway/StationComplexes.csv 14 | 15 | /// All Complexes Data Source 16 | open class Complexes: DataSource { 17 | } 18 | -------------------------------------------------------------------------------- /DataSources/Entrances.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Entrances.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // TODO: support original CSVs 12 | 13 | // Based on http://web.mta.info/developers/data/nyct/subway/StationEntrances.csv 14 | 15 | /// All Entrances Data Source 16 | open class Entrances: DataSource { 17 | } 18 | -------------------------------------------------------------------------------- /Types/Complex.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Complex.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import GTFSKit 11 | 12 | /// Complex, generally used to organize multiple stations 13 | public struct Complex: Decodable { 14 | /// ID 15 | public let id: UInt 16 | 17 | /// Name 18 | public let name: String 19 | 20 | enum CodingKeys : String, CodingKey { 21 | case id = "Complex ID" 22 | case name = "Complex Name" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NYMTAKit/NYMTAKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYMTAKit.h 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for NYMTAKit. 12 | FOUNDATION_EXPORT double NYMTAKitVersionNumber; 13 | 14 | //! Project version string for NYMTAKit. 15 | FOUNDATION_EXPORT const unsigned char NYMTAKitVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /NYMTAKitTests/ComplexesTest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ComplexesTest.swift 3 | // NYMTAKitTests 4 | // 5 | // Created by Ian Grossberg on 9/8/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import NYMTAKit 11 | 12 | class ComplexesTest: XCTestCase { 13 | func testParse() { 14 | guard let container: Complexes = createFromCSV(bundle: Bundle(for: type(of: self)), forResource: "MTA - StationComplexes", withExtension: "csv") else { 15 | return 16 | } 17 | 18 | XCTAssertEqual(container.values.count, 32, "Expected 32 complexes") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /NYMTAKitTests/EntrancesTest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EntrancesTest.swift 3 | // NYMTAKitTests 4 | // 5 | // Created by Ian Grossberg on 9/8/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import NYMTAKit 11 | 12 | class EntrancesTest: XCTestCase { 13 | func testParse() { 14 | guard let container: Entrances = createFromCSV(bundle: Bundle(for: type(of: self)), forResource: "MTA - StationEntrances", withExtension: "csv") else { 15 | return 16 | } 17 | 18 | XCTAssertEqual(container.values.count, 1866, "Expected 1866 entrances") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy.nymtakit 7 | CFBundleName 8 | NYMTAKit 9 | DocSetPlatformFamily 10 | nymtakit 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /NYMTAKitTests/StationsTest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StationsTest.swift 3 | // NYMTAKitTests 4 | // 5 | // Created by Ian Grossberg on 9/8/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import NYMTAKit 11 | 12 | class StationsTest: XCTestCase { 13 | func testParse() { 14 | guard let container: Stations = createFromCSV(bundle: Bundle(for: type(of: self)), forResource: "NYC - MTA Subway Stations", withExtension: "csv") else { 15 | return 16 | } 17 | 18 | XCTAssertEqual(container.values.count, 497, "Expected 497 stations") 19 | 20 | XCTAssertEqual(container.stationsByDaytimeRoute.keys.count, 24, "Expected 24 daytime routes") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /NYMTAKitTests/ColorsTest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Colors.swift 3 | // NYMTAKitTests 4 | // 5 | // Created by Ian Grossberg on 9/8/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import NYMTAKit 11 | 12 | class ColorsTest: XCTestCase { 13 | func testParse() { 14 | guard let container: Colors = createFromCSV(bundle: Bundle(for: type(of: self)), forResource: "MTA - colors.fixed", withExtension: "csv") else { 15 | return 16 | } 17 | 18 | XCTAssertEqual(container.values.count, 27, "Expected 27 colors") 19 | 20 | XCTAssertEqual(container.colorsByMode.keys.count, 4, "Expected 4 Modes") 21 | 22 | XCTAssertEqual(container.colorByLineOrBranch.keys.count, 39, "Expected 39 Lines / Branches") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /NYMTAKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /NYMTAKitTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NYMTAKitTests/Test Data/MTA - StationComplexes.csv: -------------------------------------------------------------------------------- 1 | Complex ID,Complex Name 2 | 601,14 St / 6 Av 3 | 602,14 St - Union Sq 4 | 603,149 St - Grand Concourse 5 | 604,161 St - Yankee Stadium 6 | 605,168 St - Washington Hts 7 | 606,Court Sq - 23 St 8 | 607,34 St - Herald Sq 9 | 608,4 Av - 9 St 10 | 609,42 St - Bryant Pk / 5 Av 11 | 610,Grand Central - 42 St 12 | 611,Times Sq - 42 St / Port Authority Bus Terminal 13 | 612,Lexington Av / 51 St 14 | 613,Lexington Av / 59 St 15 | 614,59 St - Columbus Circle 16 | 615,62 St / New Utrecht Av 17 | 616,Jackson Hts-Roosevelt Av / 74 St 18 | 617,Atlantic Av-Barclays Ctr 19 | 618,14 St / 8 Av 20 | 619,Broadway-Lafayette St / Bleecker St 21 | 620,Borough Hall / Court St 22 | 621,Broadway Junction 23 | 622,Brooklyn Bridge-City Hall/Chambers St 24 | 623,Canal St 25 | 624,Chambers St / WTC / Park Place 26 | 625,Delancey St / Essex St 27 | 626,Franklin Av / Botanic Garden 28 | 627,Franklin Av 29 | 628,Fulton St 30 | 629,Metropolitan Av / Lorimer St 31 | 630,Myrtle - Wyckoff Avs 32 | 635,South Ferry / Whitehall 33 | 636,Jay St - MetroTech 34 | -------------------------------------------------------------------------------- /Utility/Array.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Array.swift 3 | // GTFSKit 4 | // 5 | // Created by Ian Grossberg on 9/13/18. 6 | // Copyright © 2018 Jack Wilsdon. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Array { 12 | /// No matches found 13 | open class NoMatchesFoundError: Error { 14 | } 15 | 16 | /// Too many matches found when expecting one 17 | open class TooManyMatchesFoundError: Error { 18 | } 19 | 20 | /// Filter expecting only one remaining 21 | /// 22 | /// - Parameter isIncluded: Filter closure 23 | /// - Returns: The solitary match 24 | /// - Throws: When either 0 or more than 1 matches were found 25 | func filterOne(_ isIncluded: (Element) throws -> Bool) throws -> Element { 26 | let found = try self.filter(isIncluded) 27 | 28 | guard found.count < 2 else { 29 | throw TooManyMatchesFoundError() 30 | } 31 | 32 | guard let result = found.first else { 33 | throw NoMatchesFoundError() 34 | } 35 | 36 | return result 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NYMTAKit 2 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 3 | 4 | A Swift framework for processing and using [New York's MTA Open Data](http://datamine.mta.info/). Utilizing [Jack Wilsdon's GTFSKit](https://github.com/jackwilsdon/GTFSKit) for GTFS compatible portions of the MTA Open Data. 5 | 6 | ## Usage 7 | Please see the [API documentation](https://adorkable.github.io/NYMTAKit/) found in the [`docs`](docs/index.html) folder of the repo. 8 | 9 | ## Installation 10 | **NYMTAKit** is available through **[Carthage](https://github.com/Carthage/Carthage)**, to install simply add the following to your `Cartfile`: 11 | ```Ruby 12 | github "Adorkable/NYMTAKit" 13 | ``` 14 | 15 | Alternatively you can clone the **[github repo](https://github.com/Adorkable/NYMTAKit)** and build the framework manually. 16 | 17 | Contributing 18 | --- 19 | If you have any ideas, suggestions, or bugs to report please [create an issue](https://github.com/Adorkable/NYMTAKit/issues/new) (check to see if the issue exists first please!). Or create a pull request! 20 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 100% 23 | 24 | 25 | 100% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NYMTAKitTests/Test Data/MTA - colors.fixed.csv: -------------------------------------------------------------------------------- 1 | MTA Mode,Line/Branch,RGB Hex,Pantone CVC,CMYK 2 | NYCT Subway,A/C/E,0039A6,PMS 286,c100;m56 3 | NYCT Subway,B/D/F/M,FF6319,PMS 165,m60;y100 4 | NYCT Subway,G,6CBE45,PMS 376,c56;y100 5 | NYCT Subway,J/Z,996633,PMS 154,m43;y100;k34 6 | NYCT Subway,L,A7A9AC,50% black,50k 7 | NYCT Subway,N/Q/R,FCCC0A,PMS 116,m15;y94 8 | NYCT Subway,S,808183,70% black,70k 9 | NYCT Subway,1/2/3,EE352E,PMS 185,m91;y76 10 | NYCT Subway,4/5/6,00933C,PMS 355,c100;y91;6k 11 | NYCT Subway,7,B933AD,PMS Purple,c43;m91 12 | LIRR,Babylon Branch,00985F,PMS 340,c100;m11;y83;k1 13 | LIRR,City Terminal Zone,4D5357,PMS 445,c69;m56;y53;k31 14 | LIRR,Far Rockaway Branch,6E3219,PMS 168,c35;m80;y96;k43 15 | LIRR,Hempstead Branch,CE8E00,PMS 131,c17;m46;y100;k2 16 | LIRR,Long Beach Branch,FF6319,PMS 165,m75;y96 17 | LIRR,Montauk Branch,6983,PMS 315,c100;m46;y37;k12 18 | LIRR,Oyster Bay Branch,00AF3F,PMS 354,c95;y100 19 | LIRR,Port Jefferson Branch,0039A6,PMS 286,c100;m56 20 | LIRR,Port Washington Branch,C60C30,PMS 186,c13;m100;y90;k4 21 | LIRR,Ronkonkoma Branch,A626AA,PMS 253,c41;m92 22 | LIRR,West Hempstead Branch,00A1DE,PMS 299,c84;m17 23 | Metro-North,Harlem Line,0039A6,PMS 286,c100;m56 24 | Metro-North,Hudson Line,009B3A,PMS 355,c100;y91;6k 25 | Metro-North,New Haven Line,E00034,PMS 185,m91;y76 26 | Metro-North,Pascack Valley Line,923D97,PMS 513,c49;m91 27 | Metro-North,Port Jervis Line,FF7900,PMS 151,m65;y100 28 | Bridges & Tunnels,EZ Pass,6E267B,PMS 259,c67;m100;y17;k4 29 | -------------------------------------------------------------------------------- /NYMTAKitTests/Shared.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Shared.swift 3 | // NYMTAKitTests 4 | // 5 | // Created by Ian Grossberg on 9/8/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import NYMTAKit 11 | import GTFSKit 12 | 13 | func data(bundle: Bundle, forResource fileName: String, withExtension: String) -> Data? { 14 | guard let url = bundle.url(forResource: fileName, withExtension: withExtension) else { 15 | XCTFail("Unable to find color data file '\(fileName)'") 16 | return nil 17 | } 18 | let data: Data 19 | do { 20 | data = try Data(contentsOf: url) 21 | } catch { 22 | XCTFail("Reading contents of URL \(url) threw error: \(error)") 23 | return nil 24 | } 25 | return data 26 | } 27 | 28 | func createFromCSV(bundle: Bundle, forResource fileName: String, withExtension: String) -> Type? where Type: DataSource, DataSourceType: Decodable { 29 | 30 | guard let data = data(bundle: bundle, forResource: fileName, withExtension: withExtension) else { 31 | return nil 32 | } 33 | guard let string = String(data: data, encoding: .utf8) else { 34 | XCTFail("Unable to convert data '\(data)' into String from '\(fileName)'") 35 | return nil 36 | } 37 | let result: Type 38 | do { 39 | result = try Type(csv: string) 40 | } catch { 41 | XCTFail("Initializing \(Type.self) with data threw error: \(error)") 42 | return nil 43 | } 44 | return result 45 | } 46 | -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | 42 | // Dumb down quotes within code blocks that delimit strings instead of quotations 43 | // https://github.com/realm/jazzy/issues/714 44 | $("code q").replaceWith(function () { 45 | return ["\"", $(this).contents(), "\""]; 46 | }); 47 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | 42 | // Dumb down quotes within code blocks that delimit strings instead of quotations 43 | // https://github.com/realm/jazzy/issues/714 44 | $("code q").replaceWith(function () { 45 | return ["\"", $(this).contents(), "\""]; 46 | }); 47 | -------------------------------------------------------------------------------- /DataSources/Stations.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Stations.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // TODO: support original CSVs 12 | 13 | // Based on http://web.mta.info/developers/data/nyct/subway/Stations.csv 14 | 15 | /// All Stations Data Source 16 | open class Stations: DataSource { 17 | /// Stations by `Daytime Route` 18 | public var stationsByDaytimeRoute: [DaytimeRoute: [Station]] { 19 | return self._stationsByDaytimeRoute 20 | } 21 | // TODO: devise a better way of organizing flow and hopefully not make optional, this is an antipattern 22 | private var _stationsByDaytimeRoute: [DaytimeRoute: [Station]] = [:] 23 | 24 | static func stationsByDaytimeRoute(_ stations: [Station]) -> [DaytimeRoute: [Station]] { 25 | var result: [DaytimeRoute: [Station]] = [:] 26 | for station in stations { 27 | for daytimeRoute in station.daytimeRoutes { 28 | var line: [Station] 29 | if let keyedLine = result[daytimeRoute] { 30 | line = keyedLine 31 | } else { 32 | line = [] 33 | } 34 | line.append(station) 35 | result[daytimeRoute] = line 36 | } 37 | } 38 | return result 39 | } 40 | 41 | override func postValuesInitialized(values: [Station]) { 42 | super.postValuesInitialized(values: values) 43 | 44 | self._stationsByDaytimeRoute = Stations.stationsByDaytimeRoute(self.values) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DataSources/Colors.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Colors.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // TODO: support original CSVs 12 | 13 | // Based on http://web.mta.info/developers/data/colors.csv 14 | 15 | /// All MTA Colors Data Source 16 | open class Colors: DataSource { 17 | /// Colors by type of line or branch 18 | public var colorsByMode: [Color.Mode: [Color]] { 19 | return self._colorsByMode 20 | } 21 | // TODO: devise a better way of organizing flow and hopefully not make optional, this is an antipattern 22 | private var _colorsByMode: [Color.Mode: [Color]] = [:] 23 | 24 | static func colorsByMode(_ colors: [Color]) -> [Color.Mode: [Color]] { 25 | var result: [Color.Mode: [Color]] = [:] 26 | for color in colors { 27 | var list: [Color] = [] 28 | if let previous = result[color.mode] { 29 | list = previous 30 | } 31 | list.append(color) 32 | result[color.mode] = list 33 | } 34 | return result 35 | } 36 | 37 | /// Colors by line or branch name 38 | public var colorByLineOrBranch: [String: Color] { 39 | return self._colorByLineOrBranch 40 | } 41 | // TODO: devise a better way of organizing flow and hopefully not make optional, this is an antipattern 42 | private var _colorByLineOrBranch: [String: Color] = [:] 43 | 44 | static func colorByLineOrBranch(_ colors: [Color]) -> [String: Color] { 45 | var result: [String: Color] = [:] 46 | for color in colors { 47 | for line in color.lineOrBranch { 48 | result[line] = color 49 | } 50 | } 51 | return result 52 | } 53 | 54 | override func postValuesInitialized(values: [Color]) { 55 | super.postValuesInitialized(values: values) 56 | 57 | self._colorsByMode = Colors.colorsByMode(values) 58 | self._colorByLineOrBranch = Colors.colorByLineOrBranch(values) 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Types/Errors.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Errors.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Error while decoding JSON data 12 | open class DecodeJSONDataError: Error { 13 | /// Context 14 | public let context: String 15 | /// Decode error 16 | public let error: Error 17 | /// Initialize with context description and decode error 18 | /// 19 | /// - Parameters: 20 | /// - context: Context description 21 | /// - error: Decode error 22 | public init(context: String, error: Error) { 23 | self.context = context 24 | self.error = error 25 | } 26 | 27 | /// Human readable description 28 | public var localizedDescription: String { 29 | return "Error while decoding \(self.context) JSON data: \(self.error.localizedDescription)" 30 | } 31 | } 32 | 33 | /// Unable to find an expected data asset 34 | open class UnableToFindDataAssetError: Error { 35 | /// Data asset name 36 | public let dataAssetName: String 37 | /// Initialize with data asset name 38 | /// 39 | /// - Parameter dataAssetName: Data asset name 40 | public init(dataAssetName: String) { 41 | self.dataAssetName = dataAssetName 42 | } 43 | 44 | /// Human readable description 45 | public var localizedDescription: String { 46 | return "Unable to find data asset with name \(self.dataAssetName)" 47 | } 48 | } 49 | 50 | /// Encountered an unexpected value for a type in the specified context 51 | open class UnexpectedValueForTypeError: Error { 52 | /// Unexpected value 53 | public let value: String 54 | /// Type 55 | public let type: String 56 | /// Context description 57 | public let context: String 58 | /// Initialize with unexpected value for type in context 59 | /// 60 | /// - Parameters: 61 | /// - value: Unexpected value 62 | /// - type: Type 63 | /// - context: Context description 64 | public init(value: String, type: String, context: String) { 65 | self.value = value 66 | self.type = type 67 | self.context = context 68 | } 69 | 70 | /// Human readable description 71 | public var localizedDescription: String { 72 | return "Unexpected value '\(self.value)' for type '\(self.type)' in \(self.context)" 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /Types/Station.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Station.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | import GTFSKit 12 | 13 | /// Station 14 | public struct Station: Decodable { 15 | /// ID 16 | public let id: UInt 17 | /// ID of complex 18 | public let complexId: UInt 19 | func complex(complexes: Complexes) -> Complex? { 20 | var found: Complex? = nil 21 | for test in complexes.values { 22 | if test.id == self.complexId { 23 | found = test 24 | break 25 | } 26 | } 27 | return found 28 | } 29 | 30 | /// Associated GTFS Stop ID 31 | public let gtfsStopId: String 32 | 33 | /// Division 34 | public let division: String 35 | 36 | /// Line or branch 37 | public let line: String 38 | 39 | /// Name 40 | public var name: String 41 | 42 | /// Borough 43 | public let borough: String 44 | 45 | /// Daytime routes 46 | public var daytimeRoutes: [DaytimeRoute] { 47 | return self.daytimeRoutesString.split(separator: " ").map({ (substring) -> String in 48 | return String(substring) 49 | }) 50 | } 51 | let daytimeRoutesString: String 52 | 53 | /// Structure 54 | public let structure: String 55 | 56 | let gtfsLatitude: Double 57 | let gtfsLongitude: Double 58 | /// Location 59 | public var gtfsLocation: CLLocation { 60 | return CLLocation(latitude: self.gtfsLatitude, longitude: self.gtfsLongitude) 61 | } 62 | 63 | enum CodingKeys : String, CodingKey { 64 | case id = "Station ID" 65 | case complexId = "Complex ID" 66 | case gtfsStopId = "GTFS Stop ID" 67 | 68 | case division = "Division" 69 | 70 | case line = "Line" 71 | 72 | case name = "Stop Name" 73 | 74 | case borough = "Borough" 75 | 76 | case daytimeRoutesString = "Daytime Routes" 77 | 78 | case structure = "Structure" 79 | 80 | case gtfsLatitude = "GTFS Latitude" 81 | case gtfsLongitude = "GTFS Longitude" 82 | } 83 | 84 | func entrances(entrances: Entrances) -> [Entrance] { 85 | // Station name is not consistent between data sources, we're using station location for now 86 | return entrances.values.filter { $0.stationLocation == self.gtfsLocation } 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.11) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | atomos (0.1.3) 11 | claide (1.0.2) 12 | cocoapods (1.5.3) 13 | activesupport (>= 4.0.2, < 5) 14 | claide (>= 1.0.2, < 2.0) 15 | cocoapods-core (= 1.5.3) 16 | cocoapods-deintegrate (>= 1.0.2, < 2.0) 17 | cocoapods-downloader (>= 1.2.0, < 2.0) 18 | cocoapods-plugins (>= 1.0.0, < 2.0) 19 | cocoapods-search (>= 1.0.0, < 2.0) 20 | cocoapods-stats (>= 1.0.0, < 2.0) 21 | cocoapods-trunk (>= 1.3.0, < 2.0) 22 | cocoapods-try (>= 1.1.0, < 2.0) 23 | colored2 (~> 3.1) 24 | escape (~> 0.0.4) 25 | fourflusher (~> 2.0.1) 26 | gh_inspector (~> 1.0) 27 | molinillo (~> 0.6.5) 28 | nap (~> 1.0) 29 | ruby-macho (~> 1.1) 30 | xcodeproj (>= 1.5.7, < 2.0) 31 | cocoapods-core (1.5.3) 32 | activesupport (>= 4.0.2, < 6) 33 | fuzzy_match (~> 2.0.4) 34 | nap (~> 1.0) 35 | cocoapods-deintegrate (1.0.2) 36 | cocoapods-downloader (1.6.3) 37 | cocoapods-plugins (1.0.0) 38 | nap 39 | cocoapods-search (1.0.0) 40 | cocoapods-stats (1.0.0) 41 | cocoapods-trunk (1.3.1) 42 | nap (>= 0.8, < 2.0) 43 | netrc (~> 0.11) 44 | cocoapods-try (1.1.0) 45 | colored2 (3.1.2) 46 | concurrent-ruby (1.1.4) 47 | escape (0.0.4) 48 | ffi (1.9.25) 49 | fourflusher (2.0.1) 50 | fuzzy_match (2.0.4) 51 | gh_inspector (1.1.3) 52 | i18n (0.9.5) 53 | concurrent-ruby (~> 1.0) 54 | jazzy (0.9.4) 55 | cocoapods (~> 1.0) 56 | mustache (~> 0.99) 57 | open4 58 | redcarpet (~> 3.2) 59 | rouge (>= 2.0.6, < 4.0) 60 | sass (~> 3.4) 61 | sqlite3 (~> 1.3) 62 | xcinvoke (~> 0.3.0) 63 | liferaft (0.0.6) 64 | minitest (5.11.3) 65 | molinillo (0.6.6) 66 | mustache (0.99.8) 67 | nanaimo (0.2.6) 68 | nap (1.1.0) 69 | netrc (0.11.0) 70 | open4 (1.3.4) 71 | rb-fsevent (0.10.3) 72 | rb-inotify (0.10.0) 73 | ffi (~> 1.0) 74 | redcarpet (3.5.1) 75 | rouge (3.3.0) 76 | ruby-macho (1.3.1) 77 | sass (3.7.2) 78 | sass-listen (~> 4.0.0) 79 | sass-listen (4.0.0) 80 | rb-fsevent (~> 0.9, >= 0.9.4) 81 | rb-inotify (~> 0.9, >= 0.9.7) 82 | sqlite3 (1.3.13) 83 | thread_safe (0.3.6) 84 | tzinfo (1.2.5) 85 | thread_safe (~> 0.1) 86 | xcinvoke (0.3.0) 87 | liferaft (~> 0.0.6) 88 | xcodeproj (1.7.0) 89 | CFPropertyList (>= 2.3.3, < 4.0) 90 | atomos (~> 0.1.3) 91 | claide (>= 1.0.2, < 2.0) 92 | colored2 (~> 3.1) 93 | nanaimo (~> 0.2.6) 94 | 95 | PLATFORMS 96 | ruby 97 | 98 | DEPENDENCIES 99 | jazzy 100 | 101 | BUNDLED WITH 102 | 1.16.6 103 | -------------------------------------------------------------------------------- /Types/Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Color.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | 10 | #if os(iOS) 11 | import UIKit 12 | import HEXColor 13 | #else 14 | import Cocoa 15 | #endif 16 | import GTFSKit 17 | 18 | /// Line or branch color information 19 | public struct Color: Decodable { 20 | // TODO: find more appropriate place 21 | 22 | /// Enum type of line or branch 23 | public enum Mode: CustomStringConvertible { 24 | /// NYC Subway 25 | case nyctSubway 26 | /// Long Island Railroad 27 | case lirr 28 | /// Metro North 29 | case metroNorth 30 | /// Bridges and tunnels 31 | case bridgesAndTunnels 32 | /// Unknown 33 | case unknown 34 | 35 | init?(from: String) { 36 | var found: Mode? 37 | for mode in Mode.all { 38 | if mode.description == from { 39 | found = mode 40 | break 41 | } 42 | } 43 | if let found = found { 44 | self = found 45 | } else { 46 | return nil 47 | } 48 | } 49 | 50 | /// All `Mode`s 51 | public static let all: [Mode] = [ 52 | .nyctSubway, 53 | .lirr, 54 | .metroNorth, 55 | .bridgesAndTunnels, 56 | .unknown 57 | ] 58 | 59 | /// Human readable description 60 | public var description: String { 61 | switch self { 62 | case .nyctSubway: 63 | return "NYCT Subway" 64 | case .lirr: 65 | return "LIRR" 66 | case .metroNorth: 67 | return "Metro-North" 68 | case .bridgesAndTunnels: 69 | return "Bridges & Tunnels" 70 | case .unknown: 71 | return "Unknown" 72 | } 73 | } 74 | } 75 | 76 | /// Type of line or branch 77 | public var mode: Mode { 78 | guard let result = Mode(from: self.modeString) else { 79 | return .unknown 80 | } 81 | return result 82 | } 83 | /// Parsed type of line string 84 | let modeString: String 85 | 86 | /// Lines or branches for this Color 87 | public var lineOrBranch: [String] { 88 | return self.lineOrBranchString.split(separator: "/").map({ String($0) }) 89 | } 90 | /// Parsed lines or branches for this Color 91 | let lineOrBranchString: String 92 | 93 | #if os(iOS) 94 | /// as UIColor 95 | /// 96 | /// - Returns: Color value as a `UIColor` 97 | /// - Throws: If RGBHex format is invalid 98 | public func asUIColor() throws -> UIColor { 99 | return try UIColor(rgba_throws: self.rgbHex) 100 | } 101 | // #else 102 | // public func asNSColor() throws -> NSColor { 103 | // return try NSColor(rgba_throws: self.rgbHex) 104 | // } 105 | #endif 106 | /// RGB Hex value 107 | public let rgbHex: String 108 | /// Pantone CVC value 109 | public let pantoneCVC: String 110 | /// CMYK value 111 | public let cmyk: String 112 | 113 | enum CodingKeys : String, CodingKey { 114 | case modeString = "MTA Mode" 115 | case lineOrBranchString = "Line/Branch" 116 | case rgbHex = "RGB Hex" 117 | case pantoneCVC = "Pantone CVC" 118 | case cmyk = "CMYK" 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /DataSources/DataSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataSource.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import GTFSKit 11 | import CSV 12 | #if os(iOS) 13 | import UIKit 14 | #else 15 | import Cocoa 16 | #endif 17 | 18 | /// Generic Data Source for parsing NYMTA data 19 | open class DataSource where Type: Decodable { 20 | /// All values 21 | public var values: [Type] { 22 | return self._values 23 | } 24 | private var _values: [Type] 25 | 26 | 27 | /// Initialize from JSON data 28 | /// 29 | /// - Parameter json: JSON data 30 | /// - Throws: When unable to decode the JSON data 31 | public required init(json: Data) throws { 32 | let values: [Type] 33 | do { 34 | values = try JSONDecoder().decode([Type].self, from: json) 35 | } catch { 36 | throw DecodeJSONDataError(context: "\(Type.self)", error: error) 37 | } 38 | self._values = values 39 | 40 | self.postValuesInitialized(values: self._values) 41 | } 42 | 43 | /// Initialized from a JSON asset in the specified Bundle 44 | /// 45 | /// - Parameters: 46 | /// - assetName: JSON asset name 47 | /// - bundle: Bundle 48 | /// - Throws: When unable to find the data asset or unable to decode the JSON data 49 | public convenience init(jsonDataAssetName assetName: String, bundle: Bundle) throws { 50 | guard let asset = NSDataAsset(name: assetName, bundle: bundle) else { 51 | throw UnableToFindDataAssetError(dataAssetName: assetName) 52 | } 53 | 54 | try self.init(json: asset.data) 55 | } 56 | 57 | /// Initialize from CSV string 58 | /// 59 | /// - Parameter csv: CSV string 60 | /// - Throws: When unable to decode the CSV data 61 | public required init(csv: String) throws { 62 | let reader = try CSVReader(string: csv, hasHeaderRow: true, trimFields: true) 63 | 64 | var values: [Type] = [] 65 | while let value: Type = try reader.readRow() { 66 | values.append(value) 67 | } 68 | self._values = values 69 | 70 | self.postValuesInitialized(values: self._values) 71 | } 72 | 73 | /// Initialize from CSV data 74 | /// 75 | /// - Parameter csv: CSV data 76 | /// - Throws: When unable to decode the CSV data 77 | public convenience init(csv: Data) throws { 78 | guard let csvString = String(data: csv, encoding: .utf8) else { 79 | // TODO: throw 80 | throw UnableToFindDataAssetError(dataAssetName: "asldkfjalskdjfl") 81 | } 82 | 83 | try self.init(csv: csvString) 84 | } 85 | 86 | /// Initialize from a CSV asset in the specified Bundle 87 | /// 88 | /// - Parameters: 89 | /// - assetName: CSV asset name 90 | /// - bundle: Bundle 91 | /// - Throws: When unable to find the data asset or unable to decode the CSV data 92 | public convenience init(csvDataAssetName assetName: String, bundle: Bundle) throws { 93 | guard let asset = NSDataAsset(name: assetName, bundle: bundle) else { 94 | throw UnableToFindDataAssetError(dataAssetName: assetName) 95 | } 96 | 97 | try self.init(csv: asset.data) 98 | } 99 | 100 | // TODO: use more performant parsed value closure on individual parse 101 | func postValuesInitialized(values: [Type]) { 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /NYMTAKit.xcodeproj/xcshareddata/xcschemes/NYMTAKit-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /NYMTAKit.xcodeproj/xcshareddata/xcschemes/NYMTAKit-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NYMTAKit Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

NYMTAKit Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 109 |
110 |
111 |
112 | 113 |

NYMTAKit

114 | 115 |

Carthage compatible

116 | 117 |

A Swift framework for processing and using New York’s MTA Open Data. Utilizing Jack Wilsdon’s GTFSKit for GTFS compatible portions of the MTA Open Data.

118 |

Usage

119 | 120 |

Please see the API documentation found in the docs folder of the repo.

121 |

Installation

122 | 123 |

NYMTAKit is available through Carthage, to install simply add the following to your Cartfile:

124 |
github "Adorkable/NYMTAKit"
125 | 
126 | 127 |

Alternatively you can clone the github repo and build the framework manually.

128 |

Contributing

129 | 130 |

If you have any ideas, suggestions, or bugs to report please create an issue (check to see if the issue exists first please!). Or create a pull request!

131 | 132 |
133 |
134 | 138 |
139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NYMTAKit Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

NYMTAKit Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 109 |
110 |
111 |
112 | 113 |

NYMTAKit

114 | 115 |

Carthage compatible

116 | 117 |

A Swift framework for processing and using New York’s MTA Open Data. Utilizing Jack Wilsdon’s GTFSKit for GTFS compatible portions of the MTA Open Data.

118 |

Usage

119 | 120 |

Please see the API documentation found in the docs folder of the repo.

121 |

Installation

122 | 123 |

NYMTAKit is available through Carthage, to install simply add the following to your Cartfile:

124 |
github "Adorkable/NYMTAKit"
125 | 
126 | 127 |

Alternatively you can clone the github repo and build the framework manually.

128 |

Contributing

129 | 130 |

If you have any ideas, suggestions, or bugs to report please create an issue (check to see if the issue exists first please!). Or create a pull request!

131 | 132 |
133 |
134 | 138 |
139 |
140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /docs/Typealiases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Type Aliases Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Type Aliases

114 |

The following type aliases are available globally.

115 | 116 |
117 |
118 |
119 |
    120 |
  • 121 |
    122 | 123 | 124 | 125 | DaytimeRoute 126 | 127 |
    128 |
    129 |
    130 |
    131 |
    132 |
    133 |

    Daytime Route ID

    134 | 135 |
    136 |
    137 |

    Declaration

    138 |
    139 |

    Swift

    140 |
    public typealias DaytimeRoute = String
    141 | 142 |
    143 |
    144 |
    145 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | 155 |
156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Typealiases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Type Aliases Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Type Aliases

114 |

The following type aliases are available globally.

115 | 116 |
117 |
118 |
119 |
    120 |
  • 121 |
    122 | 123 | 124 | 125 | DaytimeRoute 126 | 127 |
    128 |
    129 |
    130 |
    131 |
    132 |
    133 |

    Daytime Route ID

    134 | 135 |
    136 |
    137 |

    Declaration

    138 |
    139 |

    Swift

    140 |
    public typealias DaytimeRoute = String
    141 | 142 |
    143 |
    144 |
    145 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | 155 |
156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/Extensions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Extensions Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Extensions

114 |

The following extensions are available globally.

115 | 116 |
117 |
118 |
119 |
    120 |
  • 121 |
    122 | 123 | 124 | 125 | Array 126 | 127 |
    128 |
    129 |
    130 |
    131 |
    132 |
    133 | 134 | See more 135 |
    136 |
    137 |

    Declaration

    138 |
    139 |

    Swift

    140 |
    struct Array<Element> : _DestructorSafeContainer
    141 | 142 |
    143 |
    144 |
    145 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | 155 |
156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Extensions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Extensions Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Extensions

114 |

The following extensions are available globally.

115 | 116 |
117 |
118 |
119 |
    120 |
  • 121 |
    122 | 123 | 124 | 125 | Array 126 | 127 |
    128 |
    129 |
    130 |
    131 |
    132 |
    133 | 134 | See more 135 |
    136 |
    137 |

    Declaration

    138 |
    139 |

    Swift

    140 |
    struct Array<Element> : _DestructorSafeContainer
    141 | 142 |
    143 |
    144 |
    145 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | 155 |
156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /Types/Entrance.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Entrance.swift 3 | // NYMTAKit 4 | // 5 | // Created by Ian Grossberg on 9/7/18. 6 | // Copyright © 2018 Adorkable. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | import GTFSKit 12 | 13 | /// Entrance information 14 | public struct Entrance: Decodable { 15 | /// Division 16 | public let division: String 17 | 18 | /// Line or branch 19 | public let line: String 20 | 21 | /// Station name 22 | public let stationName: String 23 | 24 | let stationLatitude: Double 25 | let stationLongitude: Double 26 | /// Station location 27 | public var stationLocation: CLLocation { 28 | return CLLocation(latitude: self.stationLatitude, longitude: self.stationLongitude) 29 | } 30 | func station(stations: Stations) throws -> Station { 31 | return try stations.values.filterOne { $0.gtfsLocation == self.stationLocation } 32 | } 33 | 34 | let route1: String? 35 | let route2: String? 36 | let route3: String? 37 | let route4: String? 38 | let route5: String? 39 | let route6: String? 40 | let route7: String? 41 | let route8: String? 42 | let route9: String? 43 | let route10: String? 44 | let route11: String? 45 | /// Routes 46 | public var routes: [String] { 47 | return [ 48 | self.route1, 49 | self.route2, 50 | self.route3, 51 | self.route4, 52 | self.route5, 53 | self.route6, 54 | self.route7, 55 | self.route8, 56 | self.route9, 57 | self.route10, 58 | self.route11 59 | ].compactMap { $0 }.filter { $0.count > 0} 60 | } 61 | 62 | let typeString: String 63 | /// Enum type of entrance 64 | public enum `Type`: CustomStringConvertible { 65 | /// Stair 66 | case stair 67 | /// Elevator 68 | case elevator 69 | /// Door 70 | case door 71 | /// Easement 72 | case easement 73 | 74 | init(from: String) throws { 75 | var found: Type? 76 | for mode in Type.all { 77 | if mode.description == from { 78 | found = mode 79 | break 80 | } 81 | } 82 | if let found = found { 83 | self = found 84 | } else { 85 | throw UnexpectedValueForTypeError(value: from, type: "Type", context: "Entrance") 86 | } 87 | } 88 | 89 | /// All `Type`s 90 | public static let all: [Type] = [ 91 | .stair, 92 | .elevator, 93 | .door, 94 | .easement 95 | ] 96 | 97 | /// Human readable description 98 | public var description: String { 99 | switch self { 100 | case .stair: 101 | return "Stair" 102 | case .elevator: 103 | return "Elevator" 104 | case .door: 105 | return "Door" 106 | case .easement: 107 | return "Easement" 108 | } 109 | } 110 | } 111 | /// Type of entrance 112 | /// 113 | /// - Returns: Type 114 | /// - Throws: When encountering an unexpectedly parsed type 115 | public func type() throws -> Type { 116 | return try Type(from: self.typeString) 117 | } 118 | 119 | static func asBool(_ string: String) -> Bool { 120 | guard string.count > 0 else { 121 | return false 122 | } 123 | guard string.uppercased() == "YES" || string.uppercased() == "TRUE" else { 124 | return false 125 | } 126 | return true 127 | } 128 | let entryString: String 129 | /// Is an entry 130 | public var entry: Bool { 131 | return Entrance.asBool(self.entryString) 132 | } 133 | 134 | let exitOnlyString: String 135 | /// Is an Exit Only 136 | public var exitOnly: Bool { 137 | return Entrance.asBool(self.exitOnlyString) 138 | } 139 | 140 | let vendingString: String 141 | /// Has vending machines 142 | public var vending: Bool { 143 | return Entrance.asBool(self.vendingString) 144 | } 145 | 146 | let staffingString: String 147 | 148 | /// Enum staffing 149 | public enum Staffing { 150 | /// Fully staffed 151 | case full 152 | /// No staff 153 | case none 154 | 155 | init(from: String) throws { 156 | var found: Staffing? 157 | for mode in Staffing.all { 158 | if mode.description == from { 159 | found = mode 160 | break 161 | } 162 | } 163 | if let found = found { 164 | self = found 165 | } else { 166 | throw UnexpectedValueForTypeError(value: from, type: "Staffing", context: "Entrance") 167 | } 168 | } 169 | 170 | /// All `Staffing` 171 | public static let all: [Staffing] = [ 172 | .full, 173 | .none 174 | ] 175 | 176 | /// Human readable description 177 | public var description: String { 178 | switch self { 179 | case .full: 180 | return "FULL" 181 | case .none: 182 | return "NONE" 183 | } 184 | } 185 | } 186 | /// Staffing 187 | /// 188 | /// - Returns: Staffing 189 | /// - Throws: When encountering an unexpectedly parsed staff value 190 | public func staffing() throws -> Staffing { 191 | return try Staffing(from: self.staffingString) 192 | } 193 | 194 | /// Staff hours 195 | public let staffHours: String // TODO: Time Range 196 | 197 | let adaString: String 198 | /// ADA compliant 199 | public var ada: Bool { 200 | return Entrance.asBool(self.adaString) 201 | } 202 | /// ADA compliancy notes 203 | public let adaNotes: String 204 | 205 | let freeCrossoverString: String 206 | /// Free crossover 207 | public var freeCrossover: Bool { 208 | return Entrance.asBool(self.freeCrossoverString) 209 | } 210 | 211 | /// North-south street entrance 212 | public let northSouthStreet: String 213 | /// East-west street entrance 214 | public let eastWestStreet: String 215 | /// Corner entrance 216 | public let corner: String 217 | 218 | let latitude: Double 219 | let longitude: Double 220 | /// Location 221 | public var location: CLLocation { 222 | return CLLocation(latitude: self.latitude, longitude: self.longitude) 223 | } 224 | 225 | enum CodingKeys : String, CodingKey { 226 | case division = "Division" 227 | case line = "Line" 228 | 229 | case stationName = "Station_Name" 230 | case stationLatitude = "Station_Latitude" 231 | case stationLongitude = "Station_Longitude" 232 | 233 | case route1 = "Route_1" 234 | case route2 = "Route_2" 235 | case route3 = "Route_3" 236 | case route4 = "Route_4" 237 | case route5 = "Route_5" 238 | case route6 = "Route_6" 239 | case route7 = "Route_7" 240 | case route8 = "Route_8" 241 | case route9 = "Route_9" 242 | case route10 = "Route_10" 243 | case route11 = "Route_11" 244 | 245 | case typeString = "Entrance_Type" 246 | 247 | case entryString = "Entry" 248 | case exitOnlyString = "Exit_Only" 249 | case vendingString = "Vending" 250 | case staffingString = "Staffing" 251 | case staffHours = "Staff_Hours" 252 | case adaString = "ADA" 253 | case adaNotes = "ADA_Notes" 254 | case freeCrossoverString = "Free_Crossover" 255 | case northSouthStreet = "North_South_Street" 256 | case eastWestStreet = "East_West_Street" 257 | 258 | case corner = "Corner" 259 | 260 | case latitude = "Latitude" 261 | case longitude = "Longitude" 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /docs/Classes/Stations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stations Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Stations

114 |
115 |
116 |
open class Stations : DataSource<Station>
117 | 118 |
119 |
120 |

All Stations Data Source

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | stationsByDaytimeRoute 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Stations by Daytime Route

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public var stationsByDaytimeRoute: [DaytimeRoute : [Station]] { get }
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
154 |
155 |
156 |
157 | 161 |
162 |
163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Classes/Stations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stations Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Stations

114 |
115 |
116 |
open class Stations : DataSource<Station>
117 | 118 |
119 |
120 |

All Stations Data Source

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | stationsByDaytimeRoute 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Stations by Daytime Route

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public var stationsByDaytimeRoute: [DaytimeRoute : [Station]] { get }
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
154 |
155 |
156 |
157 | 161 |
162 |
163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 60px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | .main-content section .heading:before { 168 | content: ""; 169 | display: block; 170 | padding-top: 70px; 171 | margin: -70px 0 0; } 172 | 173 | .section { 174 | padding: 0 25px; } 175 | 176 | .highlight { 177 | background-color: #eee; 178 | padding: 10px 12px; 179 | border: 1px solid #e2e2e2; 180 | border-radius: 4px; 181 | overflow-x: auto; } 182 | 183 | .declaration .highlight { 184 | overflow-x: initial; 185 | padding: 0 40px 40px 0; 186 | margin-bottom: -25px; 187 | background-color: transparent; 188 | border: none; } 189 | 190 | .section-name { 191 | margin: 0; 192 | margin-left: 18px; } 193 | 194 | .task-group-section { 195 | padding-left: 6px; 196 | border-top: 1px solid #e2e2e2; } 197 | 198 | .task-group { 199 | padding-top: 0px; } 200 | 201 | .task-name-container a[name]:before { 202 | content: ""; 203 | display: block; 204 | padding-top: 70px; 205 | margin: -70px 0 0; } 206 | 207 | .item { 208 | padding-top: 8px; 209 | width: 100%; 210 | list-style-type: none; } 211 | .item a[name]:before { 212 | content: ""; 213 | display: block; 214 | padding-top: 70px; 215 | margin: -70px 0 0; } 216 | .item code { 217 | background-color: transparent; 218 | padding: 0; } 219 | .item .token { 220 | padding-left: 3px; 221 | margin-left: 15px; 222 | font-size: 11.9px; } 223 | .item .declaration-note { 224 | font-size: .85em; 225 | color: gray; 226 | font-style: italic; } 227 | 228 | .pointer-container { 229 | border-bottom: 1px solid #e2e2e2; 230 | left: -23px; 231 | padding-bottom: 13px; 232 | position: relative; 233 | width: 110%; } 234 | 235 | .pointer { 236 | background: #f9f9f9; 237 | border-left: 1px solid #e2e2e2; 238 | border-top: 1px solid #e2e2e2; 239 | height: 12px; 240 | left: 21px; 241 | top: -7px; 242 | -webkit-transform: rotate(45deg); 243 | -moz-transform: rotate(45deg); 244 | -o-transform: rotate(45deg); 245 | transform: rotate(45deg); 246 | position: absolute; 247 | width: 12px; } 248 | 249 | .height-container { 250 | display: none; 251 | left: -25px; 252 | padding: 0 25px; 253 | position: relative; 254 | width: 100%; 255 | overflow: hidden; } 256 | .height-container .section { 257 | background: #f9f9f9; 258 | border-bottom: 1px solid #e2e2e2; 259 | left: -25px; 260 | position: relative; 261 | width: 100%; 262 | padding-top: 10px; 263 | padding-bottom: 5px; } 264 | 265 | .aside, .language { 266 | padding: 6px 12px; 267 | margin: 12px 0; 268 | border-left: 5px solid #dddddd; 269 | overflow-y: hidden; } 270 | .aside .aside-title, .language .aside-title { 271 | font-size: 9px; 272 | letter-spacing: 2px; 273 | text-transform: uppercase; 274 | padding-bottom: 0; 275 | margin: 0; 276 | color: #aaa; 277 | -webkit-user-select: none; } 278 | .aside p:last-child, .language p:last-child { 279 | margin-bottom: 0; } 280 | 281 | .language { 282 | border-left: 5px solid #cde9f4; } 283 | .language .aside-title { 284 | color: #4b8afb; } 285 | 286 | .aside-warning { 287 | border-left: 5px solid #ff6666; } 288 | .aside-warning .aside-title { 289 | color: #ff0000; } 290 | 291 | .graybox { 292 | border-collapse: collapse; 293 | width: 100%; } 294 | .graybox p { 295 | margin: 0; 296 | word-break: break-word; 297 | min-width: 50px; } 298 | .graybox td { 299 | border: 1px solid #e2e2e2; 300 | padding: 5px 25px 5px 10px; 301 | vertical-align: middle; } 302 | .graybox tr td:first-of-type { 303 | text-align: right; 304 | padding: 7px; 305 | vertical-align: top; 306 | word-break: normal; 307 | width: 40px; } 308 | 309 | .slightly-smaller { 310 | font-size: 0.9em; } 311 | 312 | #footer { 313 | position: absolute; 314 | bottom: 10px; 315 | margin-left: 25px; } 316 | #footer p { 317 | margin: 0; 318 | color: #aaa; 319 | font-size: 0.8em; } 320 | 321 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 322 | display: none; } 323 | html.dash .main-content { 324 | width: 980px; 325 | margin-left: 0; 326 | border: none; 327 | width: 100%; 328 | top: 0; 329 | padding-bottom: 0; } 330 | html.dash .height-container { 331 | display: block; } 332 | html.dash .item .token { 333 | margin-left: 0; } 334 | html.dash .content-wrapper { 335 | width: auto; } 336 | html.dash #footer { 337 | position: static; } 338 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 60px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | .main-content section .heading:before { 168 | content: ""; 169 | display: block; 170 | padding-top: 70px; 171 | margin: -70px 0 0; } 172 | 173 | .section { 174 | padding: 0 25px; } 175 | 176 | .highlight { 177 | background-color: #eee; 178 | padding: 10px 12px; 179 | border: 1px solid #e2e2e2; 180 | border-radius: 4px; 181 | overflow-x: auto; } 182 | 183 | .declaration .highlight { 184 | overflow-x: initial; 185 | padding: 0 40px 40px 0; 186 | margin-bottom: -25px; 187 | background-color: transparent; 188 | border: none; } 189 | 190 | .section-name { 191 | margin: 0; 192 | margin-left: 18px; } 193 | 194 | .task-group-section { 195 | padding-left: 6px; 196 | border-top: 1px solid #e2e2e2; } 197 | 198 | .task-group { 199 | padding-top: 0px; } 200 | 201 | .task-name-container a[name]:before { 202 | content: ""; 203 | display: block; 204 | padding-top: 70px; 205 | margin: -70px 0 0; } 206 | 207 | .item { 208 | padding-top: 8px; 209 | width: 100%; 210 | list-style-type: none; } 211 | .item a[name]:before { 212 | content: ""; 213 | display: block; 214 | padding-top: 70px; 215 | margin: -70px 0 0; } 216 | .item code { 217 | background-color: transparent; 218 | padding: 0; } 219 | .item .token { 220 | padding-left: 3px; 221 | margin-left: 15px; 222 | font-size: 11.9px; } 223 | .item .declaration-note { 224 | font-size: .85em; 225 | color: gray; 226 | font-style: italic; } 227 | 228 | .pointer-container { 229 | border-bottom: 1px solid #e2e2e2; 230 | left: -23px; 231 | padding-bottom: 13px; 232 | position: relative; 233 | width: 110%; } 234 | 235 | .pointer { 236 | background: #f9f9f9; 237 | border-left: 1px solid #e2e2e2; 238 | border-top: 1px solid #e2e2e2; 239 | height: 12px; 240 | left: 21px; 241 | top: -7px; 242 | -webkit-transform: rotate(45deg); 243 | -moz-transform: rotate(45deg); 244 | -o-transform: rotate(45deg); 245 | transform: rotate(45deg); 246 | position: absolute; 247 | width: 12px; } 248 | 249 | .height-container { 250 | display: none; 251 | left: -25px; 252 | padding: 0 25px; 253 | position: relative; 254 | width: 100%; 255 | overflow: hidden; } 256 | .height-container .section { 257 | background: #f9f9f9; 258 | border-bottom: 1px solid #e2e2e2; 259 | left: -25px; 260 | position: relative; 261 | width: 100%; 262 | padding-top: 10px; 263 | padding-bottom: 5px; } 264 | 265 | .aside, .language { 266 | padding: 6px 12px; 267 | margin: 12px 0; 268 | border-left: 5px solid #dddddd; 269 | overflow-y: hidden; } 270 | .aside .aside-title, .language .aside-title { 271 | font-size: 9px; 272 | letter-spacing: 2px; 273 | text-transform: uppercase; 274 | padding-bottom: 0; 275 | margin: 0; 276 | color: #aaa; 277 | -webkit-user-select: none; } 278 | .aside p:last-child, .language p:last-child { 279 | margin-bottom: 0; } 280 | 281 | .language { 282 | border-left: 5px solid #cde9f4; } 283 | .language .aside-title { 284 | color: #4b8afb; } 285 | 286 | .aside-warning { 287 | border-left: 5px solid #ff6666; } 288 | .aside-warning .aside-title { 289 | color: #ff0000; } 290 | 291 | .graybox { 292 | border-collapse: collapse; 293 | width: 100%; } 294 | .graybox p { 295 | margin: 0; 296 | word-break: break-word; 297 | min-width: 50px; } 298 | .graybox td { 299 | border: 1px solid #e2e2e2; 300 | padding: 5px 25px 5px 10px; 301 | vertical-align: middle; } 302 | .graybox tr td:first-of-type { 303 | text-align: right; 304 | padding: 7px; 305 | vertical-align: top; 306 | word-break: normal; 307 | width: 40px; } 308 | 309 | .slightly-smaller { 310 | font-size: 0.9em; } 311 | 312 | #footer { 313 | position: absolute; 314 | bottom: 10px; 315 | margin-left: 25px; } 316 | #footer p { 317 | margin: 0; 318 | color: #aaa; 319 | font-size: 0.8em; } 320 | 321 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 322 | display: none; } 323 | html.dash .main-content { 324 | width: 980px; 325 | margin-left: 0; 326 | border: none; 327 | width: 100%; 328 | top: 0; 329 | padding-bottom: 0; } 330 | html.dash .height-container { 331 | display: block; } 332 | html.dash .item .token { 333 | margin-left: 0; } 334 | html.dash .content-wrapper { 335 | width: auto; } 336 | html.dash #footer { 337 | position: static; } 338 | -------------------------------------------------------------------------------- /docs/Structs/Complex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Complex Structure Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Complex

114 |
115 |
116 |
public struct Complex : Decodable
117 | 118 |
119 |
120 |

Complex, generally used to organize multiple stations

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | id 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    ID

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public let id: UInt
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | name 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public let name: String
    174 | 175 |
    176 |
    177 |
    178 |
    179 |
  • 180 |
181 |
182 |
183 |
184 | 188 |
189 |
190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Structs/Complex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Complex Structure Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Complex

114 |
115 |
116 |
public struct Complex : Decodable
117 | 118 |
119 |
120 |

Complex, generally used to organize multiple stations

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | id 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    ID

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public let id: UInt
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | name 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public let name: String
    174 | 175 |
    176 |
    177 |
    178 |
    179 |
  • 180 |
181 |
182 |
183 |
184 | 188 |
189 |
190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/Extensions/Array.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Array Extension Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Array

114 |
115 |
116 |
struct Array<Element> : _DestructorSafeContainer
117 | 118 |
119 |
120 | 121 |
122 |
123 |
124 |
    125 |
  • 126 |
    127 | 128 | 129 | 130 | NoMatchesFoundError 131 | 132 |
    133 |
    134 |
    135 |
    136 |
    137 |
    138 |

    No matches found

    139 | 140 |
    141 |
    142 |

    Declaration

    143 |
    144 |

    Swift

    145 |
    open class NoMatchesFoundError : Error
    146 | 147 |
    148 |
    149 |
    150 |
    151 |
  • 152 |
  • 153 |
    154 | 155 | 156 | 157 | TooManyMatchesFoundError 158 | 159 |
    160 |
    161 |
    162 |
    163 |
    164 |
    165 |

    Too many matches found when expecting one

    166 | 167 |
    168 |
    169 |

    Declaration

    170 |
    171 |

    Swift

    172 |
    open class TooManyMatchesFoundError : Error
    173 | 174 |
    175 |
    176 |
    177 |
    178 |
  • 179 |
180 |
181 |
182 |
183 | 187 |
188 |
189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Extensions/Array.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Array Extension Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Array

114 |
115 |
116 |
struct Array<Element> : _DestructorSafeContainer
117 | 118 |
119 |
120 | 121 |
122 |
123 |
124 |
    125 |
  • 126 |
    127 | 128 | 129 | 130 | NoMatchesFoundError 131 | 132 |
    133 |
    134 |
    135 |
    136 |
    137 |
    138 |

    No matches found

    139 | 140 |
    141 |
    142 |

    Declaration

    143 |
    144 |

    Swift

    145 |
    open class NoMatchesFoundError : Error
    146 | 147 |
    148 |
    149 |
    150 |
    151 |
  • 152 |
  • 153 |
    154 | 155 | 156 | 157 | TooManyMatchesFoundError 158 | 159 |
    160 |
    161 |
    162 |
    163 |
    164 |
    165 |

    Too many matches found when expecting one

    166 | 167 |
    168 |
    169 |

    Declaration

    170 |
    171 |

    Swift

    172 |
    open class TooManyMatchesFoundError : Error
    173 | 174 |
    175 |
    176 |
    177 |
    178 |
  • 179 |
180 |
181 |
182 |
183 | 187 |
188 |
189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /docs/Classes/Colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Colors Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Colors

114 |
115 |
116 |
open class Colors : DataSource<Color>
117 | 118 |
119 |
120 |

All MTA Colors Data Source

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | colorsByMode 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Colors by type of line or branch

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public var colorsByMode: [Color.Mode : [Color]] { get }
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | colorByLineOrBranch 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Colors by line or branch name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public var colorByLineOrBranch: [String : Color] { get }
    174 | 175 |
    176 |
    177 |
    178 |
    179 |
  • 180 |
181 |
182 |
183 |
184 | 188 |
189 |
190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Classes/Colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Colors Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

Colors

114 |
115 |
116 |
open class Colors : DataSource<Color>
117 | 118 |
119 |
120 |

All MTA Colors Data Source

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | colorsByMode 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Colors by type of line or branch

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public var colorsByMode: [Color.Mode : [Color]] { get }
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | colorByLineOrBranch 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Colors by line or branch name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public var colorByLineOrBranch: [String : Color] { get }
    174 | 175 |
    176 |
    177 |
    178 |
    179 |
  • 180 |
181 |
182 |
183 |
184 | 188 |
189 |
190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/Classes/UnableToFindDataAssetError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UnableToFindDataAssetError Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

UnableToFindDataAssetError

114 |
115 |
116 |
open class UnableToFindDataAssetError : Error
117 | 118 |
119 |
120 |

Unable to find an expected data asset

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | dataAssetName 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Data asset name

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public let dataAssetName: String
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | init(dataAssetName:) 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Initialize with data asset name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public init(dataAssetName: String)
    174 | 175 |
    176 |
    177 |
    178 |

    Parameters

    179 | 180 | 181 | 182 | 187 | 192 | 193 | 194 |
    183 | 184 | dataAssetName 185 | 186 | 188 |
    189 |

    Data asset name

    190 |
    191 |
    195 |
    196 |
    197 |
    198 |
  • 199 |
  • 200 |
    201 | 202 | 203 | 204 | localizedDescription 205 | 206 |
    207 |
    208 |
    209 |
    210 |
    211 |
    212 |

    Human readable description

    213 | 214 |
    215 |
    216 |

    Declaration

    217 |
    218 |

    Swift

    219 |
    public var localizedDescription: String { get }
    220 | 221 |
    222 |
    223 |
    224 |
    225 |
  • 226 |
227 |
228 |
229 |
230 | 234 |
235 |
236 | 237 | 238 | 239 | -------------------------------------------------------------------------------- /docs/docsets/NYMTAKit.docset/Contents/Resources/Documents/Classes/UnableToFindDataAssetError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UnableToFindDataAssetError Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

NYMTAKit Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 110 |
111 |
112 |
113 |

UnableToFindDataAssetError

114 |
115 |
116 |
open class UnableToFindDataAssetError : Error
117 | 118 |
119 |
120 |

Unable to find an expected data asset

121 | 122 |
123 |
124 |
125 |
    126 |
  • 127 |
    128 | 129 | 130 | 131 | dataAssetName 132 | 133 |
    134 |
    135 |
    136 |
    137 |
    138 |
    139 |

    Data asset name

    140 | 141 |
    142 |
    143 |

    Declaration

    144 |
    145 |

    Swift

    146 |
    public let dataAssetName: String
    147 | 148 |
    149 |
    150 |
    151 |
    152 |
  • 153 |
  • 154 |
    155 | 156 | 157 | 158 | init(dataAssetName:) 159 | 160 |
    161 |
    162 |
    163 |
    164 |
    165 |
    166 |

    Initialize with data asset name

    167 | 168 |
    169 |
    170 |

    Declaration

    171 |
    172 |

    Swift

    173 |
    public init(dataAssetName: String)
    174 | 175 |
    176 |
    177 |
    178 |

    Parameters

    179 | 180 | 181 | 182 | 187 | 192 | 193 | 194 |
    183 | 184 | dataAssetName 185 | 186 | 188 |
    189 |

    Data asset name

    190 |
    191 |
    195 |
    196 |
    197 |
    198 |
  • 199 |
  • 200 |
    201 | 202 | 203 | 204 | localizedDescription 205 | 206 |
    207 |
    208 |
    209 |
    210 |
    211 |
    212 |

    Human readable description

    213 | 214 |
    215 |
    216 |

    Declaration

    217 |
    218 |

    Swift

    219 |
    public var localizedDescription: String { get }
    220 | 221 |
    222 |
    223 |
    224 |
    225 |
  • 226 |
227 |
228 |
229 |
230 | 234 |
235 |
236 | 237 | 238 | 239 | --------------------------------------------------------------------------------