SwiftUI Naming Conventions - samuelkripto/styleguide GitHub Wiki
SwiftUI Naming Conventions
This document provides naming conventions specifically designed for organizing SwiftUI projects in a GitHub wiki. It ensures consistency, readability, and maintainability of your documentation.
General Guidelines
- Clarity over brevity: Use descriptive and clear names for all pages and sections.
- Camel case or kebab-case: Use
PascalCasefor page titles andkebab-casefor file names. For example:- Page title:
SwiftUI Naming Conventions - File name:
swiftui-naming-conventions.md
- Page title:
- Avoid abbreviations: Write full words unless the abbreviation is widely recognized (e.g., URL, API).
- Hierarchy and structure: Organize pages logically and use prefixes to group related topics.
Naming Conventions for Pages
File Names
- Use
kebab-casefor file names to ensure compatibility and readability across all systems. Example:general-guidelines.mdproject-structure.mdnaming-conventions-components.md
Page Titles
- Use
PascalCasefor page titles and capitalize each word. Example:General GuidelinesProject StructureNaming Conventions by Component
Hierarchical Structure
- Group related topics using a logical structure:
01-General-Guidelines.md02-Project-Structure.md03-Naming-Conventions-Components.md
Content Sections
Use Headings for Structure
- Start each page with a
#heading for the title, followed by##and###for subheadings. Example:# General Guidelines ## Clarity Over Brevity Use descriptive names that clearly convey purpose, even if longer. ## Avoid Abbreviations Prefer full words unless abbreviations are widely recognized.
Code Blocks
- Use fenced code blocks for Swift examples. Specify the language (
swift) to enable syntax highlighting. Example:struct LoginView: View { var body: some View { Text("Login") } }
Lists
- Use ordered lists for step-by-step instructions and unordered lists for general points. Example:
- Use descriptive file names. - Follow a logical hierarchy.
Examples of Wiki Structure
Suggested File Structure
01-general-guidelines.md02-project-structure.md03-naming-conventions-components.md04-functions.md05-accessibility.md