Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/swift-snippets
Various nifty Swift snippets and playgrounds I have created
https://github.com/sindresorhus/swift-snippets
snippets swift swift-playgrounds
Last synced: 3 days ago
JSON representation
Various nifty Swift snippets and playgrounds I have created
- Host: GitHub
- URL: https://github.com/sindresorhus/swift-snippets
- Owner: sindresorhus
- License: mit
- Created: 2017-08-29T07:05:33.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2022-09-22T17:10:17.000Z (about 2 years ago)
- Last Synced: 2024-05-22T18:05:00.787Z (4 months ago)
- Topics: snippets, swift, swift-playgrounds
- Language: Swift
- Homepage:
- Size: 2.93 KB
- Stars: 60
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
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)*