A collection of useful Xcode code snippets for Swift development.
To use these snippets in Xcode:
- Download the desired
.codesnippetfile - Place it in:
~/Library/Developer/Xcode/UserData/CodeSnippets/ - Restart Xcode
- Type the completion prefix to use the snippet
| Title | Description | Scope | Language | File |
|---|---|---|---|---|
| Enum - Secret | - | All | Swift | Link |
| Extension - View - Template | base template for an Extension | All | Swift | Link |
| Function - Decode API Response | - | All | Swift | Link |
| Other - DispatchQueueMain | - | All | Swift | Link |
| Other - Timer | Small Snippet to create a TImer on a view | All | Swift | Link |
| SwiftData - Store Color | Exemple of storing a color in SwiftData | All | Swift | Link |
| Class - Cache | Small class that implement simple cache | Top Level | Swift | Link |
| Class - Log | - | Top Level | Swift | Link |
| Class - NavigationService | Navigation Class | Top Level | Swift | Link |
| Class - SoundService | Minimal Sound Service to play a sound | Top Level | Swift | Link |
| Extension - Bundle | Extension of Bundle to read any Type of Json | Top Level | Swift | Link |
| Extension - ShapeStyle Background | Extension of ShapeStyle to add Colors.XXX | Top Level | Swift | Link |
| Extension - UIApplication Release/Build/AppVersion | - | Top Level | Swift | Link |
| Other - FaceID | - | Top Level | Swift | Link |
| View - ImageBlurredView | ScrollView with Blurred Image at Top | Top Level | Swift | Link |
| Other - Comparable | Static Function | Class Implementation | Swift | Link |
For detailed documentation including the full code of each snippet, see SNIPPETS.md.