I think we're done

This commit is contained in:
cdricms
2026-03-21 18:25:21 +01:00
parent 2d1e8e1044
commit ba9e2db1b9
26 changed files with 281 additions and 63 deletions

View File

@@ -4,3 +4,38 @@ Documentation and reference for the MusicBrainz API implementation.
## Search API Reference
- [MusicBrainz Search API Documentation](https://musicbrainz.org/doc/MusicBrainz_API/Search)
## SwiftUI and SwiftData Readiness
The library is designed to be cross-platform and modern-Swift ready.
### SwiftUI
All models conform to `Identifiable`, `Hashable`, and `Equatable`. This makes them perfect for:
- Efficient list rendering using `ForEach`.
- State management with `@State` or `@Observable`.
- Value-based equality checks.
### SwiftData Bridging
Since this library is cross-platform, it does not import `SwiftData` directly. To persist MusicBrainz entities in SwiftData, you should create separate `@Model` classes and bridge them.
**Example:**
```swift
import SwiftData
import MusicBrainz
@Model
class PersistentArtist {
@Attribute(.unique) var id: String
var name: String
var country: String?
init(from artist: MusicBrainz.Artist) {
self.id = artist.id
self.name = artist.name
self.country = artist.country
}
}
```
Bridging DTOs to local storage models ensures that your persistence layer remains decoupled from the network layer, which is a best practice.