# swift-snippets **Repository Path**: mirrors_sindresorhus/swift-snippets ## Basic Information - **Project Name**: swift-snippets - **Description**: Various nifty Swift snippets and playgrounds I have created - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Swift snippets > Various nifty Swift snippets and playgrounds I have created ## [macOS Dark Mode handling](DarkMode.playground/Contents.swift) ```swift print(DarkMode.isEnabled) DarkMode.onChange = { isEnabled in print("Is dark mode enabled?", isEnabled) } ``` Playground: `DarkMode.playground` *(Clone the repo and double-click this file)*