Skip Navigation
Instance MethodMethod

swiftCaseName(for:)

Converts a theme name to the name of its enumeration case.

func swiftCaseName(for themeName: String) -> String

Parameters

themeName

The theme name.

Return Value

The Swift identifier of the case (without back-ticks).

Discussion

The built-in name prefix (docc-static-) is dropped and the remaining kebab-case name is converted to lower camel case, so docc-static-classic becomes classic and my-custom-theme becomes myCustomTheme.