{"id":32110794,"url":"https://github.com/engrahsanali/aacoredata","last_synced_at":"2026-02-21T17:02:08.464Z","repository":{"id":56840120,"uuid":"77614486","full_name":"EngrAhsanAli/AACoreData","owner":"EngrAhsanAli","description":"AACoreData is a lightweight data persistence wrapper designed to provide an easier solution for `CRUD` operations using CoreData in Swift.","archived":false,"fork":false,"pushed_at":"2019-05-31T12:00:51.000Z","size":2575,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-25T21:41:55.990Z","etag":null,"topics":["coredata","crud","database","persistent-data","sqlite3"],"latest_commit_sha":null,"homepage":"https://cocoapods.org/pods/AACoreData","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EngrAhsanAli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-29T13:35:15.000Z","updated_at":"2020-05-30T07:45:18.000Z","dependencies_parsed_at":"2022-08-28T23:31:03.721Z","dependency_job_id":null,"html_url":"https://github.com/EngrAhsanAli/AACoreData","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/EngrAhsanAli/AACoreData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngrAhsanAli%2FAACoreData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngrAhsanAli%2FAACoreData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngrAhsanAli%2FAACoreData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngrAhsanAli%2FAACoreData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngrAhsanAli","download_url":"https://codeload.github.com/EngrAhsanAli/AACoreData/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngrAhsanAli%2FAACoreData/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29688216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coredata","crud","database","persistent-data","sqlite3"],"created_at":"2025-10-20T14:03:21.494Z","updated_at":"2026-02-21T17:02:08.453Z","avatar_url":"https://github.com/EngrAhsanAli.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table of Contents\n\n- [AACoreData](#section-id-3)\n  - [Description](#section-id-10)\n  - [Demonstration](#section-id-15)\n  - [Requirements](#section-id-24)\n- [Installation](#section-id-29)\n  - [CocoaPods](#section-id-33)\n  - [Carthage](#section-id-56)\n  - [Manual Installation](#section-id-74)\n- [Getting Started](#section-id-87)\n  - [Define entities](#section-id-83)\n  - [Shared Instance](#section-id-92)\n  - [Creating your own data model](#section-id-102)\n  - [Create new entity object](#section-id-119)\n  - [Save your changes](#section-id-128)\n  - [Fetch your records](#section-id-138)\n  - [Delete a object](#section-id-166)\n  - [Delete all objects](#section-id-180)\n- [Contributions \u0026 License](#section-id-192)\n\n\n\n\u003cdiv id='section-id-3'/\u003e\n\n#AACoreData\n\n[![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://developer.apple.com/swift/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/AACoreData.svg)](http://cocoadocs.org/docsets/AACoreData) [![License MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/EngrAhsanAli/AACoreData.svg?branch=master)](https://travis-ci.org/EngrAhsanAli/AACoreData) \n![License MIT](https://img.shields.io/github/license/mashape/apistatus.svg) [![CocoaPods](https://img.shields.io/cocoapods/p/AACoreData.svg)]()\n\n\n\u003cdiv id='section-id-10'/\u003e\n\n##Description\n\n\nAACoreData is a lightweight data persistence wrapper designed to provide an easier solution for `CRUD` operations using `CoreData`, written in Swift. It provides a singleton instance to access `CoreData` objects anywhere in the code and uses 'value types' to define `CoreData` entities.\n\n\u003cdiv id='section-id-15'/\u003e\n\n##Demonstration\n\n\n\n![](https://github.com/EngrAhsanAli/AACoreData/blob/master/Screenshots/demo.gif)\n\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\u003cdiv id='section-id-24'/\u003e\n\n##Requirements\n\n- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+\n- Xcode 8.0+\n\n\u003cdiv id='section-id-29'/\u003e\n\n# Installation\n\nAACoreData can be installed using CocoaPods, Carthage, or manually.\n\n\u003cdiv id='section-id-33'/\u003e\n\n##CocoaPods\n\nAACoreData is available through [CocoaPods](http://cocoapods.org). To install CocoaPods, run:\n\n$ gem install cocoapods\n\nThen create a Podfile with the following contents:\n\n```\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\npod 'AACoreData', '~\u003e 1.0'\nend\n\n```\n\nFinally, run the following command to install it:\n```\n$ pod install\n```\n\n\u003cdiv id='section-id-56'/\u003e\n\n##Carthage\n\nTo install Carthage, run (using Homebrew):\n```\n$ brew update\n$ brew install carthage\n```\nThen add the following line to your Cartfile:\n\n```\ngithub \"EngrAhsanAli/AACoreData\" \n```\n\nThen import the library in all files where you use it:\n```ruby\nimport AACoreData\n```\n\n\u003cdiv id='section-id-74'/\u003e\n\n##Manual Installation\n\nSimply copy `Classes/AACoreData.swift` to your Xcode project and that's it!\n\n\n\u003cdiv id='section-id-87'/\u003e\n\n#Getting Started\n----------\n\n\n\u003cdiv id='section-id-83'/\u003e\n\n##Define entities\n\n```ruby\nextension AACoreData {\n    static let myEntity = AACoreEntity(\"ExampleEntity\")\n}\n```\n\n\u003cdiv id='section-id-92'/\u003e\n\n##Shared Instance\n\nYou can access the instance easily by adding this line in specific class or globally anywhere outside the class: \n\n```ruby\nlet instance = AACoreData.shared\n```\n\n\n\u003cdiv id='section-id-102'/\u003e\n\n##Creating your own data model\n\nYou have to create your own data model file in your project. By default `\"AACoreData.xcdatamodeld\"` is assumed to find in your project bundle like `./YouAppName/AACoreData.xcdatamodeld`\nIf you want to create different name of data model, then you have to specify it by using singleton property in `AppDelegate.swift`\n\n```ruby\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n\n    AACoreData.shared.dataModel = \"ExampleDataModel\"\n    return true\n}\n```\n\n\n\n\u003cdiv id='section-id-119'/\u003e\n\n##Create new entity object \n```ruby\nlet record = instance.getNewObject(entityName: .myEntity) as! ExampleEntity\n```\n\n\n\n\u003cdiv id='section-id-128'/\u003e\n\n##Save your changes  \n\n```\ninstance.saveContext()\n```\n\n\n\n\u003cdiv id='section-id-138'/\u003e\n\n##Fetch your records \n\nYou can fetch your objects easily.\nNote that parameters 'predicate' and 'sortDescriptors' are optional\n\n```\ninstance.fetchRecords(entityName: #ENTITY#, predicate: #PREDICATE#, sortDescriptors: #SORTDECRIPTORS#, completion: #COMPLETION BLOCK#)\n```\n\nYou can easily check the object's existence or fetch the required persist data\n\n```ruby\ninstance.fetchRecords(entityName: .myEntity, sortDescriptors: [sorter]) { (results) in\nif let result = results {\n// MARK:- Record(s) found\n// You can fetch using loop\n}\nelse {\n// MARK:- No Record found\n// You can insert new record to avoid redundancy\n}\n}\n```\n\n\n\n\n\u003cdiv id='section-id-166'/\u003e\n\n##Delete a object\n\nYou can easily delete an object using shared instance.\n\n```\ninstance.deleteRecord(record)\n```\n\n\u003e **Tip:** Don't forget to save changes after update persisted data using `instance.saveContext()`\n\u003e \n\n\n\n\u003cdiv id='section-id-180'/\u003e\n\n##Delete all objects\n\nYou can easily remove all the records from an entity using shared instance\n\n```\ninstance.deleteAllRecords(entity: .Example)\n```\n\n\n\n\u003cdiv id='section-id-192'/\u003e\n\n#Contributions \u0026 License\n\n`AACoreData` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.\n\nPull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.\n\nI would love to know if you are using `AACoreData` in your app, send an email to [Engr. Ahsan Ali](mailto:hafiz.m.ahsan.ali@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengrahsanali%2Faacoredata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengrahsanali%2Faacoredata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengrahsanali%2Faacoredata/lists"}