├── .gitignore ├── .ruby-version ├── Bicycle.xcodeproj ├── Bicycle_Info.plist ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ └── Bicycle-Package.xcscheme ├── Docs ├── Classes.html ├── Classes │ ├── Bicycle.html │ └── Bicycle │ │ ├── Gearing.html │ │ ├── Handlebar.html │ │ └── Style.html ├── badge.svg ├── css │ ├── highlight.css │ └── jazzy.css ├── docsets │ ├── .docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes.html │ │ │ ├── Classes │ │ │ │ ├── Bicycle.html │ │ │ │ └── Bicycle │ │ │ │ │ ├── Gearing.html │ │ │ │ │ ├── Handlebar.html │ │ │ │ │ └── Style.html │ │ │ ├── css │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── img │ │ │ │ ├── carat.png │ │ │ │ ├── dash.png │ │ │ │ └── gh.png │ │ │ ├── index.html │ │ │ ├── js │ │ │ │ ├── jazzy.js │ │ │ │ └── jquery.min.js │ │ │ └── search.json │ │ │ └── docSet.dsidx │ └── .tgz ├── img │ ├── carat.png │ ├── dash.png │ └── gh.png ├── index.html ├── js │ ├── jazzy.js │ └── jquery.min.js ├── search.json └── undocumented.json ├── Gemfile ├── Gemfile.lock ├── Package.swift ├── README.md └── Sources └── Bicycle └── Bicycle.swift /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.4.3 -------------------------------------------------------------------------------- /Bicycle.xcodeproj/Bicycle_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Bicycle.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = "1"; 4 | objectVersion = "46"; 5 | objects = { 6 | "Bicycle::Bicycle" = { 7 | isa = "PBXNativeTarget"; 8 | buildConfigurationList = "OBJ_16"; 9 | buildPhases = ( 10 | "OBJ_19", 11 | "OBJ_21" 12 | ); 13 | dependencies = ( 14 | ); 15 | name = "Bicycle"; 16 | productName = "Bicycle"; 17 | productReference = "Bicycle::Bicycle::Product"; 18 | productType = "com.apple.product-type.framework"; 19 | }; 20 | "Bicycle::Bicycle::Product" = { 21 | isa = "PBXFileReference"; 22 | path = "Bicycle.framework"; 23 | sourceTree = "BUILT_PRODUCTS_DIR"; 24 | }; 25 | "Bicycle::SwiftPMPackageDescription" = { 26 | isa = "PBXNativeTarget"; 27 | buildConfigurationList = "OBJ_23"; 28 | buildPhases = ( 29 | "OBJ_26" 30 | ); 31 | dependencies = ( 32 | ); 33 | name = "BicyclePackageDescription"; 34 | productName = "BicyclePackageDescription"; 35 | productType = "com.apple.product-type.framework"; 36 | }; 37 | "OBJ_1" = { 38 | isa = "PBXProject"; 39 | attributes = { 40 | LastUpgradeCheck = "9999"; 41 | }; 42 | buildConfigurationList = "OBJ_2"; 43 | compatibilityVersion = "Xcode 3.2"; 44 | developmentRegion = "English"; 45 | hasScannedForEncodings = "0"; 46 | knownRegions = ( 47 | "en" 48 | ); 49 | mainGroup = "OBJ_5"; 50 | productRefGroup = "OBJ_13"; 51 | projectDirPath = "."; 52 | targets = ( 53 | "Bicycle::Bicycle", 54 | "Bicycle::SwiftPMPackageDescription" 55 | ); 56 | }; 57 | "OBJ_10" = { 58 | isa = "PBXGroup"; 59 | children = ( 60 | ); 61 | name = "Tests"; 62 | path = ""; 63 | sourceTree = "SOURCE_ROOT"; 64 | }; 65 | "OBJ_11" = { 66 | isa = "PBXFileReference"; 67 | path = "docs"; 68 | sourceTree = "SOURCE_ROOT"; 69 | }; 70 | "OBJ_12" = { 71 | isa = "PBXFileReference"; 72 | path = "build"; 73 | sourceTree = "SOURCE_ROOT"; 74 | }; 75 | "OBJ_13" = { 76 | isa = "PBXGroup"; 77 | children = ( 78 | "Bicycle::Bicycle::Product" 79 | ); 80 | name = "Products"; 81 | path = ""; 82 | sourceTree = "BUILT_PRODUCTS_DIR"; 83 | }; 84 | "OBJ_16" = { 85 | isa = "XCConfigurationList"; 86 | buildConfigurations = ( 87 | "OBJ_17", 88 | "OBJ_18" 89 | ); 90 | defaultConfigurationIsVisible = "0"; 91 | defaultConfigurationName = "Release"; 92 | }; 93 | "OBJ_17" = { 94 | isa = "XCBuildConfiguration"; 95 | buildSettings = { 96 | ENABLE_TESTABILITY = "YES"; 97 | FRAMEWORK_SEARCH_PATHS = ( 98 | "$(inherited)", 99 | "$(PLATFORM_DIR)/Developer/Library/Frameworks" 100 | ); 101 | HEADER_SEARCH_PATHS = ( 102 | "$(inherited)" 103 | ); 104 | INFOPLIST_FILE = "Bicycle.xcodeproj/Bicycle_Info.plist"; 105 | LD_RUNPATH_SEARCH_PATHS = ( 106 | "$(inherited)", 107 | "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" 108 | ); 109 | OTHER_CFLAGS = ( 110 | "$(inherited)" 111 | ); 112 | OTHER_LDFLAGS = ( 113 | "$(inherited)" 114 | ); 115 | OTHER_SWIFT_FLAGS = ( 116 | "$(inherited)" 117 | ); 118 | PRODUCT_BUNDLE_IDENTIFIER = "Bicycle"; 119 | PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; 120 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 121 | SKIP_INSTALL = "YES"; 122 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( 123 | "$(inherited)" 124 | ); 125 | SWIFT_VERSION = "4.2"; 126 | TARGET_NAME = "Bicycle"; 127 | }; 128 | name = "Debug"; 129 | }; 130 | "OBJ_18" = { 131 | isa = "XCBuildConfiguration"; 132 | buildSettings = { 133 | ENABLE_TESTABILITY = "YES"; 134 | FRAMEWORK_SEARCH_PATHS = ( 135 | "$(inherited)", 136 | "$(PLATFORM_DIR)/Developer/Library/Frameworks" 137 | ); 138 | HEADER_SEARCH_PATHS = ( 139 | "$(inherited)" 140 | ); 141 | INFOPLIST_FILE = "Bicycle.xcodeproj/Bicycle_Info.plist"; 142 | LD_RUNPATH_SEARCH_PATHS = ( 143 | "$(inherited)", 144 | "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" 145 | ); 146 | OTHER_CFLAGS = ( 147 | "$(inherited)" 148 | ); 149 | OTHER_LDFLAGS = ( 150 | "$(inherited)" 151 | ); 152 | OTHER_SWIFT_FLAGS = ( 153 | "$(inherited)" 154 | ); 155 | PRODUCT_BUNDLE_IDENTIFIER = "Bicycle"; 156 | PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; 157 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 158 | SKIP_INSTALL = "YES"; 159 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( 160 | "$(inherited)" 161 | ); 162 | SWIFT_VERSION = "4.2"; 163 | TARGET_NAME = "Bicycle"; 164 | }; 165 | name = "Release"; 166 | }; 167 | "OBJ_19" = { 168 | isa = "PBXSourcesBuildPhase"; 169 | files = ( 170 | "OBJ_20" 171 | ); 172 | }; 173 | "OBJ_2" = { 174 | isa = "XCConfigurationList"; 175 | buildConfigurations = ( 176 | "OBJ_3", 177 | "OBJ_4" 178 | ); 179 | defaultConfigurationIsVisible = "0"; 180 | defaultConfigurationName = "Release"; 181 | }; 182 | "OBJ_20" = { 183 | isa = "PBXBuildFile"; 184 | fileRef = "OBJ_9"; 185 | }; 186 | "OBJ_21" = { 187 | isa = "PBXFrameworksBuildPhase"; 188 | files = ( 189 | ); 190 | }; 191 | "OBJ_23" = { 192 | isa = "XCConfigurationList"; 193 | buildConfigurations = ( 194 | "OBJ_24", 195 | "OBJ_25" 196 | ); 197 | defaultConfigurationIsVisible = "0"; 198 | defaultConfigurationName = "Release"; 199 | }; 200 | "OBJ_24" = { 201 | isa = "XCBuildConfiguration"; 202 | buildSettings = { 203 | LD = "/usr/bin/true"; 204 | OTHER_SWIFT_FLAGS = ( 205 | "-swift-version", 206 | "4.2", 207 | "-I", 208 | "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2", 209 | "-target", 210 | "x86_64-apple-macosx10.10", 211 | "-sdk", 212 | "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk" 213 | ); 214 | SWIFT_VERSION = "4.2"; 215 | }; 216 | name = "Debug"; 217 | }; 218 | "OBJ_25" = { 219 | isa = "XCBuildConfiguration"; 220 | buildSettings = { 221 | LD = "/usr/bin/true"; 222 | OTHER_SWIFT_FLAGS = ( 223 | "-swift-version", 224 | "4.2", 225 | "-I", 226 | "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2", 227 | "-target", 228 | "x86_64-apple-macosx10.10", 229 | "-sdk", 230 | "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk" 231 | ); 232 | SWIFT_VERSION = "4.2"; 233 | }; 234 | name = "Release"; 235 | }; 236 | "OBJ_26" = { 237 | isa = "PBXSourcesBuildPhase"; 238 | files = ( 239 | "OBJ_27" 240 | ); 241 | }; 242 | "OBJ_27" = { 243 | isa = "PBXBuildFile"; 244 | fileRef = "OBJ_6"; 245 | }; 246 | "OBJ_3" = { 247 | isa = "XCBuildConfiguration"; 248 | buildSettings = { 249 | CLANG_ENABLE_OBJC_ARC = "YES"; 250 | COMBINE_HIDPI_IMAGES = "YES"; 251 | COPY_PHASE_STRIP = "NO"; 252 | DEBUG_INFORMATION_FORMAT = "dwarf"; 253 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 254 | ENABLE_NS_ASSERTIONS = "YES"; 255 | GCC_OPTIMIZATION_LEVEL = "0"; 256 | GCC_PREPROCESSOR_DEFINITIONS = ( 257 | "DEBUG=1", 258 | "$(inherited)" 259 | ); 260 | MACOSX_DEPLOYMENT_TARGET = "10.10"; 261 | ONLY_ACTIVE_ARCH = "YES"; 262 | OTHER_SWIFT_FLAGS = ( 263 | "-DXcode" 264 | ); 265 | PRODUCT_NAME = "$(TARGET_NAME)"; 266 | SDKROOT = "macosx"; 267 | SUPPORTED_PLATFORMS = ( 268 | "macosx", 269 | "iphoneos", 270 | "iphonesimulator", 271 | "appletvos", 272 | "appletvsimulator", 273 | "watchos", 274 | "watchsimulator" 275 | ); 276 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( 277 | "SWIFT_PACKAGE", 278 | "DEBUG" 279 | ); 280 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 281 | USE_HEADERMAP = "NO"; 282 | }; 283 | name = "Debug"; 284 | }; 285 | "OBJ_4" = { 286 | isa = "XCBuildConfiguration"; 287 | buildSettings = { 288 | CLANG_ENABLE_OBJC_ARC = "YES"; 289 | COMBINE_HIDPI_IMAGES = "YES"; 290 | COPY_PHASE_STRIP = "YES"; 291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 292 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 293 | GCC_OPTIMIZATION_LEVEL = "s"; 294 | MACOSX_DEPLOYMENT_TARGET = "10.10"; 295 | OTHER_SWIFT_FLAGS = ( 296 | "-DXcode" 297 | ); 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | SDKROOT = "macosx"; 300 | SUPPORTED_PLATFORMS = ( 301 | "macosx", 302 | "iphoneos", 303 | "iphonesimulator", 304 | "appletvos", 305 | "appletvsimulator", 306 | "watchos", 307 | "watchsimulator" 308 | ); 309 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( 310 | "SWIFT_PACKAGE" 311 | ); 312 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 313 | USE_HEADERMAP = "NO"; 314 | }; 315 | name = "Release"; 316 | }; 317 | "OBJ_5" = { 318 | isa = "PBXGroup"; 319 | children = ( 320 | "OBJ_6", 321 | "OBJ_7", 322 | "OBJ_10", 323 | "OBJ_11", 324 | "OBJ_12", 325 | "OBJ_13" 326 | ); 327 | path = ""; 328 | sourceTree = ""; 329 | }; 330 | "OBJ_6" = { 331 | isa = "PBXFileReference"; 332 | explicitFileType = "sourcecode.swift"; 333 | path = "Package.swift"; 334 | sourceTree = ""; 335 | }; 336 | "OBJ_7" = { 337 | isa = "PBXGroup"; 338 | children = ( 339 | "OBJ_8" 340 | ); 341 | name = "Sources"; 342 | path = ""; 343 | sourceTree = "SOURCE_ROOT"; 344 | }; 345 | "OBJ_8" = { 346 | isa = "PBXGroup"; 347 | children = ( 348 | "OBJ_9" 349 | ); 350 | name = "Bicycle"; 351 | path = "Sources/Bicycle"; 352 | sourceTree = "SOURCE_ROOT"; 353 | }; 354 | "OBJ_9" = { 355 | isa = "PBXFileReference"; 356 | path = "Bicycle.swift"; 357 | sourceTree = ""; 358 | }; 359 | }; 360 | rootObject = "OBJ_1"; 361 | } 362 | -------------------------------------------------------------------------------- /Bicycle.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Bicycle.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | -------------------------------------------------------------------------------- /Bicycle.xcodeproj/xcshareddata/xcschemes/Bicycle-Package.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Docs/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Classes

53 |

The following classes are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | Bicycle 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    🚲 A two-wheeled, human-powered mode of transportation.

    73 | 74 | See more 75 |
    76 |
    77 |

    Declaration

    78 |
    79 |

    Swift

    80 |
    public class Bicycle
    81 | 82 |
    83 |
    84 |
    85 |
    86 |
  • 87 |
88 |
89 |
90 |
91 | 95 |
96 |
97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Docs/Classes/Bicycle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bicycle Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Bicycle

53 |
54 |
55 |
public class Bicycle
56 | 57 |
58 |
59 |

🚲 A two-wheeled, human-powered mode of transportation.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | Style 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    Frame and construction style.

    79 | 80 | See more 81 |
    82 |
    83 |

    Declaration

    84 |
    85 |

    Swift

    86 |
    public enum Style
    87 | 88 |
    89 |
    90 |
    91 |
    92 |
  • 93 |
  • 94 |
    95 | 96 | 97 | 98 | Gearing 99 | 100 |
    101 |
    102 |
    103 |
    104 |
    105 |
    106 |

    Mechanism for converting pedal power into motion.

    107 | 108 | See more 109 |
    110 |
    111 |

    Declaration

    112 |
    113 |

    Swift

    114 |
    public enum Gearing
    115 | 116 |
    117 |
    118 |
    119 |
    120 |
  • 121 |
  • 122 |
    123 | 124 | 125 | 126 | Handlebar 127 | 128 |
    129 |
    130 |
    131 |
    132 |
    133 |
    134 |

    Hardware used for steering.

    135 | 136 | See more 137 |
    138 |
    139 |

    Declaration

    140 |
    141 |

    Swift

    142 |
    public enum Handlebar
    143 | 144 |
    145 |
    146 |
    147 |
    148 |
  • 149 |
  • 150 |
    151 | 152 | 153 | 154 | style 155 | 156 |
    157 |
    158 |
    159 |
    160 |
    161 |
    162 |

    The style of the bicycle.

    163 | 164 |
    165 |
    166 |

    Declaration

    167 |
    168 |

    Swift

    169 |
    public let style: Style
    170 | 171 |
    172 |
    173 |
    174 |
    175 |
  • 176 |
  • 177 |
    178 | 179 | 180 | 181 | gearing 182 | 183 |
    184 |
    185 |
    186 |
    187 |
    188 |
    189 |

    The gearing of the bicycle.

    190 | 191 |
    192 |
    193 |

    Declaration

    194 |
    195 |

    Swift

    196 |
    public let gearing: Gearing
    197 | 198 |
    199 |
    200 |
    201 |
    202 |
  • 203 |
  • 204 |
    205 | 206 | 207 | 208 | handlebar 209 | 210 |
    211 |
    212 |
    213 |
    214 |
    215 |
    216 |

    The handlebar of the bicycle.

    217 | 218 |
    219 |
    220 |

    Declaration

    221 |
    222 |

    Swift

    223 |
    public let handlebar: Handlebar
    224 | 225 |
    226 |
    227 |
    228 |
    229 |
  • 230 |
  • 231 |
    232 | 233 | 234 | 235 | frameSize 236 | 237 |
    238 |
    239 |
    240 |
    241 |
    242 |
    243 |

    The size of the frame, in centimeters.

    244 | 245 |
    246 |
    247 |

    Declaration

    248 |
    249 |

    Swift

    250 |
    public let frameSize: Int
    251 | 252 |
    253 |
    254 |
    255 |
    256 |
  • 257 |
  • 258 |
    259 | 260 | 261 | 262 | init(style:gearing:handlebar:frameSize:) 263 | 264 |
    265 |
    266 |
    267 |
    268 |
    269 |
    270 |

    Initializes a new bicycle with the provided parts and specifications.

    271 | 272 |
    273 |
    274 |

    Declaration

    275 |
    276 |

    Swift

    277 |
    public init(style: Style,
    278 |             gearing: Gearing,
    279 |             handlebar: Handlebar,
    280 |             frameSize centimeters: Int)
    281 | 282 |
    283 |
    284 |
    285 |

    Parameters

    286 | 287 | 288 | 289 | 294 | 299 | 300 | 301 | 306 | 311 | 312 | 313 | 318 | 323 | 324 | 325 | 330 | 335 | 336 | 337 |
    290 | 291 | style 292 | 293 | 295 |
    296 |

    The style of the bicycle

    297 |
    298 |
    302 | 303 | gearing 304 | 305 | 307 |
    308 |

    The gearing of the bicycle

    309 |
    310 |
    314 | 315 | handlebar 316 | 317 | 319 |
    320 |

    The handlebar of the bicycle

    321 |
    322 |
    326 | 327 | frameSize 328 | 329 | 331 |
    332 |

    The frame size of the bicycle, in centimeters

    333 |
    334 |
    338 |
    339 |
    340 |

    Return Value

    341 |

    A beautiful, brand-new bicycle, 342 | custom-built just for you.

    343 |
    344 |
    345 |
    346 |
  • 347 |
  • 348 |
    349 | 350 | 351 | 352 | travel(distance:) 353 | 354 |
    355 |
    356 |
    357 |
    358 |
    359 |
    360 |

    Take a bike out for a spin.

    361 |
    362 |

    Precondition

    363 | meters must be greater than 0. 364 | 365 |
    366 | 367 |
    368 |
    369 |

    Declaration

    370 |
    371 |

    Swift

    372 |
    public func travel(distance meters: Double)
    373 | 374 |
    375 |
    376 |
    377 |

    Parameters

    378 | 379 | 380 | 381 | 386 | 391 | 392 | 393 |
    382 | 383 | meters 384 | 385 | 387 |
    388 |

    The distance to travel in meters.

    389 |
    390 |
    394 |
    395 |
    396 |
    397 |
  • 398 |
399 |
400 |
401 | 408 |
    409 |
  • 410 |
    411 | 412 | 413 | 414 | description 415 | 416 |
    417 |
    418 |
    419 |
    420 |
    421 |
    422 | 423 |
    424 |
    425 |

    Declaration

    426 |
    427 |

    Swift

    428 |
    public var description: String { get }
    429 | 430 |
    431 |
    432 |
    433 |
    434 |
  • 435 |
436 |
437 |
438 |
439 | 443 |
444 |
445 | 446 | 447 | 448 | -------------------------------------------------------------------------------- /Docs/Classes/Bicycle/Gearing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gearing Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Gearing

53 |
54 |
55 |
public enum Gearing
56 | 57 |
58 |
59 |

Mechanism for converting pedal power into motion.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | fixed 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A single, fixed gear.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case fixed
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | freewheel(speeds:) 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    A variable-speed, disengageable gear.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case freewheel(speeds: Int)
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
120 |
121 |
122 |
123 | 127 |
128 |
129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Docs/Classes/Bicycle/Handlebar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Handlebar Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Handlebar

53 |
54 |
55 |
public enum Handlebar
56 | 57 |
58 |
59 |

Hardware used for steering.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | riser 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A casual handlebar.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case riser
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | café 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    An upright handlebar.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case café
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
  • 120 |
    121 | 122 | 123 | 124 | drop 125 | 126 |
    127 |
    128 |
    129 |
    130 |
    131 |
    132 |

    A classic handlebar.

    133 | 134 |
    135 |
    136 |

    Declaration

    137 |
    138 |

    Swift

    139 |
    case drop
    140 | 141 |
    142 |
    143 |
    144 |
    145 |
  • 146 |
  • 147 |
    148 | 149 | 150 | 151 | bullhorn 152 | 153 |
    154 |
    155 |
    156 |
    157 |
    158 |
    159 |

    A powerful handlebar.

    160 | 161 |
    162 |
    163 |

    Declaration

    164 |
    165 |

    Swift

    166 |
    case bullhorn
    167 | 168 |
    169 |
    170 |
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
177 | 181 |
182 |
183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /Docs/Classes/Bicycle/Style.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Style Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Style

53 |
54 |
55 |
public enum Style
56 | 57 |
58 |
59 |

Frame and construction style.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | road 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A style for streets or trails.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case road
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | touring 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    A style for long journeys.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case touring
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
  • 120 |
    121 | 122 | 123 | 124 | cruiser 125 | 126 |
    127 |
    128 |
    129 |
    130 |
    131 |
    132 |

    A style for casual trips around town.

    133 | 134 |
    135 |
    136 |

    Declaration

    137 |
    138 |

    Swift

    139 |
    case cruiser
    140 | 141 |
    142 |
    143 |
    144 |
    145 |
  • 146 |
  • 147 |
    148 | 149 | 150 | 151 | hybrid 152 | 153 |
    154 |
    155 |
    156 |
    157 |
    158 |
    159 |

    A style for general-purpose transportation.

    160 | 161 |
    162 |
    163 |

    Declaration

    164 |
    165 |

    Swift

    166 |
    case hybrid
    167 | 168 |
    169 |
    170 |
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
177 | 181 |
182 |
183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy. 7 | CFBundleName 8 | 9 | DocSetPlatformFamily 10 | 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Classes

53 |

The following classes are available globally.

54 | 55 |
56 |
57 |
58 |
    59 |
  • 60 |
    61 | 62 | 63 | 64 | Bicycle 65 | 66 |
    67 |
    68 |
    69 |
    70 |
    71 |
    72 |

    🚲 A two-wheeled, human-powered mode of transportation.

    73 | 74 | See more 75 |
    76 |
    77 |

    Declaration

    78 |
    79 |

    Swift

    80 |
    public class Bicycle
    81 | 82 |
    83 |
    84 |
    85 |
    86 |
  • 87 |
88 |
89 |
90 |
91 | 95 |
96 |
97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/Classes/Bicycle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bicycle Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Bicycle

53 |
54 |
55 |
public class Bicycle
56 | 57 |
58 |
59 |

🚲 A two-wheeled, human-powered mode of transportation.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | Style 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    Frame and construction style.

    79 | 80 | See more 81 |
    82 |
    83 |

    Declaration

    84 |
    85 |

    Swift

    86 |
    public enum Style
    87 | 88 |
    89 |
    90 |
    91 |
    92 |
  • 93 |
  • 94 |
    95 | 96 | 97 | 98 | Gearing 99 | 100 |
    101 |
    102 |
    103 |
    104 |
    105 |
    106 |

    Mechanism for converting pedal power into motion.

    107 | 108 | See more 109 |
    110 |
    111 |

    Declaration

    112 |
    113 |

    Swift

    114 |
    public enum Gearing
    115 | 116 |
    117 |
    118 |
    119 |
    120 |
  • 121 |
  • 122 |
    123 | 124 | 125 | 126 | Handlebar 127 | 128 |
    129 |
    130 |
    131 |
    132 |
    133 |
    134 |

    Hardware used for steering.

    135 | 136 | See more 137 |
    138 |
    139 |

    Declaration

    140 |
    141 |

    Swift

    142 |
    public enum Handlebar
    143 | 144 |
    145 |
    146 |
    147 |
    148 |
  • 149 |
  • 150 |
    151 | 152 | 153 | 154 | style 155 | 156 |
    157 |
    158 |
    159 |
    160 |
    161 |
    162 |

    The style of the bicycle.

    163 | 164 |
    165 |
    166 |

    Declaration

    167 |
    168 |

    Swift

    169 |
    public let style: Style
    170 | 171 |
    172 |
    173 |
    174 |
    175 |
  • 176 |
  • 177 |
    178 | 179 | 180 | 181 | gearing 182 | 183 |
    184 |
    185 |
    186 |
    187 |
    188 |
    189 |

    The gearing of the bicycle.

    190 | 191 |
    192 |
    193 |

    Declaration

    194 |
    195 |

    Swift

    196 |
    public let gearing: Gearing
    197 | 198 |
    199 |
    200 |
    201 |
    202 |
  • 203 |
  • 204 |
    205 | 206 | 207 | 208 | handlebar 209 | 210 |
    211 |
    212 |
    213 |
    214 |
    215 |
    216 |

    The handlebar of the bicycle.

    217 | 218 |
    219 |
    220 |

    Declaration

    221 |
    222 |

    Swift

    223 |
    public let handlebar: Handlebar
    224 | 225 |
    226 |
    227 |
    228 |
    229 |
  • 230 |
  • 231 |
    232 | 233 | 234 | 235 | frameSize 236 | 237 |
    238 |
    239 |
    240 |
    241 |
    242 |
    243 |

    The size of the frame, in centimeters.

    244 | 245 |
    246 |
    247 |

    Declaration

    248 |
    249 |

    Swift

    250 |
    public let frameSize: Int
    251 | 252 |
    253 |
    254 |
    255 |
    256 |
  • 257 |
  • 258 |
    259 | 260 | 261 | 262 | init(style:gearing:handlebar:frameSize:) 263 | 264 |
    265 |
    266 |
    267 |
    268 |
    269 |
    270 |

    Initializes a new bicycle with the provided parts and specifications.

    271 | 272 |
    273 |
    274 |

    Declaration

    275 |
    276 |

    Swift

    277 |
    public init(style: Style,
    278 |             gearing: Gearing,
    279 |             handlebar: Handlebar,
    280 |             frameSize centimeters: Int)
    281 | 282 |
    283 |
    284 |
    285 |

    Parameters

    286 | 287 | 288 | 289 | 294 | 299 | 300 | 301 | 306 | 311 | 312 | 313 | 318 | 323 | 324 | 325 | 330 | 335 | 336 | 337 |
    290 | 291 | style 292 | 293 | 295 |
    296 |

    The style of the bicycle

    297 |
    298 |
    302 | 303 | gearing 304 | 305 | 307 |
    308 |

    The gearing of the bicycle

    309 |
    310 |
    314 | 315 | handlebar 316 | 317 | 319 |
    320 |

    The handlebar of the bicycle

    321 |
    322 |
    326 | 327 | frameSize 328 | 329 | 331 |
    332 |

    The frame size of the bicycle, in centimeters

    333 |
    334 |
    338 |
    339 |
    340 |

    Return Value

    341 |

    A beautiful, brand-new bicycle, 342 | custom-built just for you.

    343 |
    344 |
    345 |
    346 |
  • 347 |
  • 348 |
    349 | 350 | 351 | 352 | travel(distance:) 353 | 354 |
    355 |
    356 |
    357 |
    358 |
    359 |
    360 |

    Take a bike out for a spin.

    361 |
    362 |

    Precondition

    363 | meters must be greater than 0. 364 | 365 |
    366 | 367 |
    368 |
    369 |

    Declaration

    370 |
    371 |

    Swift

    372 |
    public func travel(distance meters: Double)
    373 | 374 |
    375 |
    376 |
    377 |

    Parameters

    378 | 379 | 380 | 381 | 386 | 391 | 392 | 393 |
    382 | 383 | meters 384 | 385 | 387 |
    388 |

    The distance to travel in meters.

    389 |
    390 |
    394 |
    395 |
    396 |
    397 |
  • 398 |
399 |
400 |
401 | 408 |
    409 |
  • 410 |
    411 | 412 | 413 | 414 | description 415 | 416 |
    417 |
    418 |
    419 |
    420 |
    421 |
    422 | 423 |
    424 |
    425 |

    Declaration

    426 |
    427 |

    Swift

    428 |
    public var description: String { get }
    429 | 430 |
    431 |
    432 |
    433 |
    434 |
  • 435 |
436 |
437 |
438 |
439 | 443 |
444 |
445 | 446 | 447 | 448 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/Classes/Bicycle/Gearing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gearing Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Gearing

53 |
54 |
55 |
public enum Gearing
56 | 57 |
58 |
59 |

Mechanism for converting pedal power into motion.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | fixed 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A single, fixed gear.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case fixed
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | freewheel(speeds:) 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    A variable-speed, disengageable gear.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case freewheel(speeds: Int)
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
120 |
121 |
122 |
123 | 127 |
128 |
129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/Classes/Bicycle/Handlebar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Handlebar Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Handlebar

53 |
54 |
55 |
public enum Handlebar
56 | 57 |
58 |
59 |

Hardware used for steering.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | riser 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A casual handlebar.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case riser
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | café 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    An upright handlebar.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case café
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
  • 120 |
    121 | 122 | 123 | 124 | drop 125 | 126 |
    127 |
    128 |
    129 |
    130 |
    131 |
    132 |

    A classic handlebar.

    133 | 134 |
    135 |
    136 |

    Declaration

    137 |
    138 |

    Swift

    139 |
    case drop
    140 | 141 |
    142 |
    143 |
    144 |
    145 |
  • 146 |
  • 147 |
    148 | 149 | 150 | 151 | bullhorn 152 | 153 |
    154 |
    155 |
    156 |
    157 |
    158 |
    159 |

    A powerful handlebar.

    160 | 161 |
    162 |
    163 |

    Declaration

    164 |
    165 |

    Swift

    166 |
    case bullhorn
    167 | 168 |
    169 |
    170 |
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
177 | 181 |
182 |
183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/Classes/Bicycle/Style.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Style Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 49 |
50 |
51 |
52 |

Style

53 |
54 |
55 |
public enum Style
56 | 57 |
58 |
59 |

Frame and construction style.

60 | 61 |
62 |
63 |
64 |
    65 |
  • 66 |
    67 | 68 | 69 | 70 | road 71 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |

    A style for streets or trails.

    79 | 80 |
    81 |
    82 |

    Declaration

    83 |
    84 |

    Swift

    85 |
    case road
    86 | 87 |
    88 |
    89 |
    90 |
    91 |
  • 92 |
  • 93 |
    94 | 95 | 96 | 97 | touring 98 | 99 |
    100 |
    101 |
    102 |
    103 |
    104 |
    105 |

    A style for long journeys.

    106 | 107 |
    108 |
    109 |

    Declaration

    110 |
    111 |

    Swift

    112 |
    case touring
    113 | 114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
  • 120 |
    121 | 122 | 123 | 124 | cruiser 125 | 126 |
    127 |
    128 |
    129 |
    130 |
    131 |
    132 |

    A style for casual trips around town.

    133 | 134 |
    135 |
    136 |

    Declaration

    137 |
    138 |

    Swift

    139 |
    case cruiser
    140 | 141 |
    142 |
    143 |
    144 |
    145 |
  • 146 |
  • 147 |
    148 | 149 | 150 | 151 | hybrid 152 | 153 |
    154 |
    155 |
    156 |
    157 |
    158 |
    159 |

    A style for general-purpose transportation.

    160 | 161 |
    162 |
    163 |

    Declaration

    164 |
    165 |

    Swift

    166 |
    case hybrid
    167 | 168 |
    169 |
    170 |
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
177 | 181 |
182 |
183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /Docs/docsets/.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/docsets/.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/docsets/.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/docsets/.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/docsets/.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/docsets/.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |
18 |
19 |
20 | 25 |
26 |
27 | 48 |
49 |
50 |
51 | 52 |

Swift Documentation Example

53 | 54 |

A companion project to the 55 | NSHipster article about Swift Documentation.

56 |

Requirements

57 | 58 |
    59 |
  • Xcode
  • 60 |
  • Git 2.16.2+
  • 61 |
  • Ruby 2.4.3+
  • 62 |
  • Bundler
  • 63 |
64 |

Generating Docs

65 | 66 |

First, clone the repository by opening Terminal.app 67 | and running the following commands:

68 |
$ git clone git@github.com:NSHipster/Swift-Documentation-Example.git
69 | $ cd Swift-Documentation-Example
70 | 
71 | 72 |

Next, download project dependencies with Bundler using the command:

73 |
$ bundle install
74 | 
75 | 76 |

Now, use Jazzy 77 | to generate web pages from the documentation comments of this Swift project:

78 |
$ bundle exec jazzy
79 | 
80 | 81 |

Now open the server address in a web browser to see a local copy of the site 82 | (by default, Jekyll serves to localhost on port 4000):

83 |
$ open http://localhost:4000
84 | 
85 | 86 |
87 |
88 | 92 |
93 |
94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Docs/docsets/.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 | -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/Documents/search.json: -------------------------------------------------------------------------------- 1 | {"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO5riseryA2DmF":{"name":"riser","abstract":"

A casual handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO007caf_dmayA2DmF":{"name":"café","abstract":"

An upright handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO4dropyA2DmF":{"name":"drop","abstract":"

A classic handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO8bullhornyA2DmF":{"name":"bullhorn","abstract":"

A powerful handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Gearing.html#/s:7BicycleAAC7GearingO5fixedyA2DmF":{"name":"fixed","abstract":"

A single, fixed gear.

","parent_name":"Gearing"},"Classes/Bicycle/Gearing.html#/s:7BicycleAAC7GearingO9freewheelyADSi_tcADmF":{"name":"freewheel(speeds:)","abstract":"

A variable-speed, disengageable gear.

","parent_name":"Gearing"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO4roadyA2DmF":{"name":"road","abstract":"

A style for streets or trails.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO7touringyA2DmF":{"name":"touring","abstract":"

A style for long journeys.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO7cruiseryA2DmF":{"name":"cruiser","abstract":"

A style for casual trips around town.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO6hybridyA2DmF":{"name":"hybrid","abstract":"

A style for general-purpose transportation.

","parent_name":"Style"},"Classes/Bicycle/Style.html":{"name":"Style","abstract":"

Frame and construction style.

","parent_name":"Bicycle"},"Classes/Bicycle/Gearing.html":{"name":"Gearing","abstract":"

Mechanism for converting pedal power into motion.

","parent_name":"Bicycle"},"Classes/Bicycle/Handlebar.html":{"name":"Handlebar","abstract":"

Hardware used for steering.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC5styleAB5StyleOvp":{"name":"style","abstract":"

The style of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC7gearingAB7GearingOvp":{"name":"gearing","abstract":"

The gearing of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC9handlebarAB9HandlebarOvp":{"name":"handlebar","abstract":"

The handlebar of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC9frameSizeSivp":{"name":"frameSize","abstract":"

The size of the frame, in centimeters.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC5style7gearing9handlebar9frameSizeA2B5StyleO_AB7GearingOAB9HandlebarOSitcfc":{"name":"init(style:gearing:handlebar:frameSize:)","abstract":"

Initializes a new bicycle with the provided parts and specifications.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC6travel8distanceySd_tF":{"name":"travel(distance:)","abstract":"

Take a bike out for a spin.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"Bicycle"},"Classes/Bicycle.html":{"name":"Bicycle","abstract":"

🚲 A two-wheeled, human-powered mode of transportation.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"}} -------------------------------------------------------------------------------- /Docs/docsets/.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/docsets/.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /Docs/docsets/.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/docsets/.tgz -------------------------------------------------------------------------------- /Docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/img/carat.png -------------------------------------------------------------------------------- /Docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/img/dash.png -------------------------------------------------------------------------------- /Docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSHipster/Swift-Documentation-Example/6a83a367c98027e31475d6119245d79ad4a84710/Docs/img/gh.png -------------------------------------------------------------------------------- /Docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |
18 |
19 |
20 | 25 |
26 |
27 | 48 |
49 |
50 |
51 | 52 |

Swift Documentation Example

53 | 54 |

A companion project to the 55 | NSHipster article about Swift Documentation.

56 |

Requirements

57 | 58 |
    59 |
  • Xcode
  • 60 |
  • Git 2.16.2+
  • 61 |
  • Ruby 2.4.3+
  • 62 |
  • Bundler
  • 63 |
64 |

Generating Docs

65 | 66 |

First, clone the repository by opening Terminal.app 67 | and running the following commands:

68 |
$ git clone git@github.com:NSHipster/Swift-Documentation-Example.git
69 | $ cd Swift-Documentation-Example
70 | 
71 | 72 |

Next, download project dependencies with Bundler using the command:

73 |
$ bundle install
74 | 
75 | 76 |

Now, use Jazzy 77 | to generate web pages from the documentation comments of this Swift project:

78 |
$ bundle exec jazzy
79 | 
80 | 81 |

Now open the server address in a web browser to see a local copy of the site 82 | (by default, Jekyll serves to localhost on port 4000):

83 |
$ open http://localhost:4000
84 | 
85 | 86 |
87 |
88 | 92 |
93 |
94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /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/search.json: -------------------------------------------------------------------------------- 1 | {"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO5riseryA2DmF":{"name":"riser","abstract":"

A casual handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO007caf_dmayA2DmF":{"name":"café","abstract":"

An upright handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO4dropyA2DmF":{"name":"drop","abstract":"

A classic handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Handlebar.html#/s:7BicycleAAC9HandlebarO8bullhornyA2DmF":{"name":"bullhorn","abstract":"

A powerful handlebar.

","parent_name":"Handlebar"},"Classes/Bicycle/Gearing.html#/s:7BicycleAAC7GearingO5fixedyA2DmF":{"name":"fixed","abstract":"

A single, fixed gear.

","parent_name":"Gearing"},"Classes/Bicycle/Gearing.html#/s:7BicycleAAC7GearingO9freewheelyADSi_tcADmF":{"name":"freewheel(speeds:)","abstract":"

A variable-speed, disengageable gear.

","parent_name":"Gearing"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO4roadyA2DmF":{"name":"road","abstract":"

A style for streets or trails.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO7touringyA2DmF":{"name":"touring","abstract":"

A style for long journeys.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO7cruiseryA2DmF":{"name":"cruiser","abstract":"

A style for casual trips around town.

","parent_name":"Style"},"Classes/Bicycle/Style.html#/s:7BicycleAAC5StyleO6hybridyA2DmF":{"name":"hybrid","abstract":"

A style for general-purpose transportation.

","parent_name":"Style"},"Classes/Bicycle/Style.html":{"name":"Style","abstract":"

Frame and construction style.

","parent_name":"Bicycle"},"Classes/Bicycle/Gearing.html":{"name":"Gearing","abstract":"

Mechanism for converting pedal power into motion.

","parent_name":"Bicycle"},"Classes/Bicycle/Handlebar.html":{"name":"Handlebar","abstract":"

Hardware used for steering.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC5styleAB5StyleOvp":{"name":"style","abstract":"

The style of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC7gearingAB7GearingOvp":{"name":"gearing","abstract":"

The gearing of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC9handlebarAB9HandlebarOvp":{"name":"handlebar","abstract":"

The handlebar of the bicycle.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC9frameSizeSivp":{"name":"frameSize","abstract":"

The size of the frame, in centimeters.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC5style7gearing9handlebar9frameSizeA2B5StyleO_AB7GearingOAB9HandlebarOSitcfc":{"name":"init(style:gearing:handlebar:frameSize:)","abstract":"

Initializes a new bicycle with the provided parts and specifications.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:7BicycleAAC6travel8distanceySd_tF":{"name":"travel(distance:)","abstract":"

Take a bike out for a spin.

","parent_name":"Bicycle"},"Classes/Bicycle.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"Bicycle"},"Classes/Bicycle.html":{"name":"Bicycle","abstract":"

🚲 A two-wheeled, human-powered mode of transportation.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"}} -------------------------------------------------------------------------------- /Docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/mattt/Desktop/Bike" 6 | } -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'jazzy' 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.10) 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.2.1) 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.0.5) 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.3) 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.9.10) 73 | ffi (>= 0.5.0, < 2) 74 | redcarpet (3.5.1) 75 | rouge (3.3.0) 76 | ruby-macho (1.3.1) 77 | sass (3.6.0) 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.6.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.3 103 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.2 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Bicycle", 8 | products: [ 9 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 10 | .library( 11 | name: "Bicycle", 12 | targets: ["Bicycle"]), 13 | ], 14 | dependencies: [ 15 | // Dependencies declare other packages that this package depends on. 16 | // .package(url: /* package url */, from: "1.0.0"), 17 | ], 18 | targets: [ 19 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 20 | // Targets can depend on other targets in this package, and on products in packages which this package depends on. 21 | .target( 22 | name: "Bicycle", 23 | dependencies: []), 24 | ] 25 | ) 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚲 Bicycle - Swift Documentation Example 2 | 3 | A companion project to the 4 | [NSHipster article about Swift Documentation](https://nshipster.com/swift-documentation/). 5 | 6 | ## Requirements 7 | 8 | - Xcode 9 | - Git 2.16.2+ 10 | - Ruby 2.4.3+ 11 | - [Bundler](https://bundler.io) 12 | 13 | ## Generating Docs 14 | 15 | First, clone the repository by opening Terminal.app 16 | and running the following commands: 17 | 18 | ```terminal 19 | $ git clone git@github.com:NSHipster/Swift-Documentation-Example.git 20 | $ cd Swift-Documentation-Example 21 | ``` 22 | 23 | Next, download project dependencies with Bundler using the command: 24 | 25 | ```terminal 26 | $ bundle install 27 | ``` 28 | 29 | Use [Jazzy](https://github.com/realm/jazzy) 30 | to generate web pages from the documentation comments of this Swift project: 31 | 32 | ```terminal 33 | $ bundle exec jazzy -o Docs 34 | ``` 35 | 36 | Now open the `index.html` from the `Docs` directory 37 | to view the generated documentation: 38 | 39 | ```terminal 40 | $ open Docs/index.html 41 | ``` 42 | 43 | ## License 44 | 45 | This project is released under the 46 | [MIT License](https://opensource.org/licenses/MIT). 47 | See the LICENSE file for more info. 48 | 49 | NSHipster® and the NSHipster Logo 50 | are registered trademarks of Read Evaluate Press, LLC. 51 | -------------------------------------------------------------------------------- /Sources/Bicycle/Bicycle.swift: -------------------------------------------------------------------------------- 1 | /// 🚲 A two-wheeled, human-powered mode of transportation. 2 | public class Bicycle { 3 | /// Frame and construction style. 4 | public enum Style { 5 | /// A style for streets or trails. 6 | case road 7 | 8 | /// A style for long journeys. 9 | case touring 10 | 11 | /// A style for casual trips around town. 12 | case cruiser 13 | 14 | /// A style for general-purpose transportation. 15 | case hybrid 16 | } 17 | 18 | /// Mechanism for converting pedal power into motion. 19 | public enum Gearing { 20 | /// A single, fixed gear. 21 | case fixed 22 | 23 | /// A variable-speed, disengageable gear. 24 | case freewheel(speeds: Int) 25 | } 26 | 27 | /// Hardware used for steering. 28 | public enum Handlebar { 29 | /// A casual handlebar. 30 | case riser 31 | 32 | /// An upright handlebar. 33 | case café 34 | 35 | /// A classic handlebar. 36 | case drop 37 | 38 | /// A powerful handlebar. 39 | case bullhorn 40 | } 41 | 42 | /// The style of the bicycle. 43 | public let style: Style 44 | 45 | /// The gearing of the bicycle. 46 | public let gearing: Gearing 47 | 48 | /// The handlebar of the bicycle. 49 | public let handlebar: Handlebar 50 | 51 | /// The size of the frame, in centimeters. 52 | public let frameSize: Int 53 | 54 | /// The number of trips travelled by the bicycle. 55 | private(set) var numberOfTrips: Int 56 | 57 | /// The total distance travelled by the bicycle, in meters. 58 | private(set) var distanceTravelled: Double 59 | 60 | /** 61 | Initializes a new bicycle with the provided parts and specifications. 62 | 63 | - Parameters: 64 | - style: The style of the bicycle 65 | - gearing: The gearing of the bicycle 66 | - handlebar: The handlebar of the bicycle 67 | - frameSize: The frame size of the bicycle, in centimeters 68 | 69 | - Returns: A beautiful, brand-new bicycle, 70 | custom-built just for you. 71 | */ 72 | public init(style: Style, 73 | gearing: Gearing, 74 | handlebar: Handlebar, 75 | frameSize centimeters: Int) 76 | { 77 | self.style = style 78 | self.gearing = gearing 79 | self.handlebar = handlebar 80 | self.frameSize = centimeters 81 | 82 | self.numberOfTrips = 0 83 | self.distanceTravelled = 0 84 | } 85 | 86 | /** 87 | Take a bike out for a spin. 88 | 89 | - Parameter meters: The distance to travel in meters. 90 | - Precondition: `meters` must be greater than 0. 91 | */ 92 | public func travel(distance meters: Double) { 93 | precondition(meters > 0) 94 | distanceTravelled += meters 95 | numberOfTrips += 1 96 | } 97 | } 98 | 99 | // MARK: CustomStringConvertible 100 | 101 | extension Bicycle: CustomStringConvertible { 102 | public var description: String { 103 | var descriptors: [String] = [] 104 | 105 | switch self.style { 106 | case .road: 107 | descriptors.append("A road bike for streets or trails") 108 | case .touring: 109 | descriptors.append("A touring bike for long journeys") 110 | case .cruiser: 111 | descriptors.append("A cruiser bike for casual trips around town") 112 | case .hybrid: 113 | descriptors.append("A hybrid bike for general-purpose transportation") 114 | } 115 | 116 | switch self.gearing { 117 | case .fixed: 118 | descriptors.append("with a single, fixed gear") 119 | case .freewheel(let n): 120 | descriptors.append("with a \(n)-speed freewheel gear") 121 | } 122 | 123 | switch self.handlebar { 124 | case .riser: 125 | descriptors.append("and casual, riser handlebars") 126 | case .café: 127 | descriptors.append("and upright, café handlebars") 128 | case .drop: 129 | descriptors.append("and classic, drop handlebars") 130 | case .bullhorn: 131 | descriptors.append("and powerful bullhorn handlebars") 132 | } 133 | 134 | descriptors.append("on a \(frameSize)″ frame") 135 | 136 | // FIXME: Use a distance formatter 137 | descriptors.append("with a total of \(distanceTravelled) meters traveled over \(numberOfTrips) trips.") 138 | 139 | // TODO: Allow bikes to be named? 140 | 141 | return descriptors.joined(separator: ", ") 142 | } 143 | } 144 | 145 | --------------------------------------------------------------------------------