SwiftUI Naming Conventions - vonix-id/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 PascalCase for page titles and kebab-case for file names. For example:
    • Page title: SwiftUI Naming Conventions
    • File name: swiftui-naming-conventions.md
  • 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-case for file names to ensure compatibility and readability across all systems. Example:
    • general-guidelines.md
    • project-structure.md
    • naming-conventions-components.md

Page Titles

  • Use PascalCase for page titles and capitalize each word. Example:
    • General Guidelines
    • Project Structure
    • Naming Conventions by Component

Hierarchical Structure

  • Group related topics using a logical structure:
    • 01-General-Guidelines.md
    • 02-Project-Structure.md
    • 03-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.md
  • 02-project-structure.md
  • 03-naming-conventions-components.md
  • 04-functions.md
  • 05-accessibility.md