- July 30, 2025
- Mins Read
A powerful and elegant Core Data framework for Swift.
let query = persistentContainer.viewContext.people
.where { \.city == “Piracicaba” }
.orderBy { \.name }
for person in query.dropFirst(20).prefix(10) {
print(person.name, person.address)
}
Or that:
persistentContainer.performBackgroundTask { context in
let query = context.people
.filtered(using: \.country == “Brazil” && \.isContributor == true)
.sorted(by: .descending(\.contributionCount))
.sorted(by: \.name)
if let person = query.first() {
print(person.name, person.email)
}
}
After that:
import AlecrimCoreData
extension ManagedObjectContext {
var people: Query<Person> { return Query(in: self) }
}
let persistentContainer = PersistentContainer()
And after your have created your matching managed object model in Xcode, of course. 😉
If you have any problems or need more information, please open an issue using the provided GitHub link.
You can also contribute by fixing errors or creating new features. When doing this, please submit your pull requests to this repository as I do not have much time to “hunt” forks for not submitted patches.
PermissionsSwiftUI displays and handles permissions in SwiftUI. It is largely inspired by SPPermissions. The UI is highly customizable and resembles an Apple style. ...
Introduction PagerTabStripView is the first pager view built in pure SwiftUI. It provides a component to create interactive pager views ...
1. Taking Action When a Property Changes: Property Observers Swift lets you observe and respond to changes in a property’s ...