[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10392":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":37,"lastSyncTime":38,"discoverSource":39},10392,"realm-swift","realm\u002Frealm-swift","realm","Realm is a mobile database: a replacement for Core Data & SQLite","https:\u002F\u002Frealm.io",null,"Objective-C",16607,2230,359,474,0,4,11,73.1,"Apache License 2.0",false,"community",true,[25,26,27,28,29,30,31,32,33],"database","ios","mobile","mobile-database","objective-c","realtime","swift","sync","threadsafe","2026-06-12 04:00:50","\u003Cpicture>\n    \u003Csource srcset=\".\u002Fmedia\u002Flogo-dark.svg\" media=\"(prefers-color-scheme: dark)\" alt=\"realm\">\n    \u003Cimg src=\".\u002Fmedia\u002Flogo.svg\" alt=\"realm\">\n\u003C\u002Fpicture>\n\n# About Realm Database\n\nRealm is a mobile database that runs directly inside phones, tablets or wearables.\nThis repository holds the source code for the iOS, macOS, tvOS & watchOS versions of Realm Swift & Realm Objective-C.\n\n## Why Use Realm\n\n* **Intuitive to Developers:** Realm’s object-oriented data model is simple to learn, doesn’t need an ORM, and lets you write less code.\n* **Built for Mobile:** Realm is fully-featured, lightweight, and efficiently uses memory, disk space, and battery life.\n* **Designed for Offline Use:** Realm’s local database persists data on-disk, so apps work as well offline as they do online.\n\n## Object-Oriented: Streamline Your Code\n\nRealm was built for mobile developers, with simplicity in mind. The idiomatic, object-oriented data model can save you thousands of lines of code.\n\n```swift\n\u002F\u002F Define your models like regular Swift classes\nclass Dog: Object {\n    @Persisted var name: String\n    @Persisted var age: Int\n}\nclass Person: Object {\n    @Persisted(primaryKey: true) var _id: String\n    @Persisted var name: String\n    @Persisted var age: Int\n    \u002F\u002F Create relationships by pointing an Object field to another Class\n    @Persisted var dogs: List\u003CDog>\n}\n\u002F\u002F Use them like regular Swift objects\nlet dog = Dog()\ndog.name = \"Rex\"\ndog.age = 1\nprint(\"name of dog: \\(dog.name)\")\n\n\u002F\u002F Get the default Realm\nlet realm = try! Realm()\n\u002F\u002F Persist your data easily with a write transaction\ntry! realm.write {\n    realm.add(dog)\n}\n```\n## Live Objects: Build Reactive Apps\nRealm’s live objects mean data updated anywhere is automatically updated everywhere.\n```swift\n\u002F\u002F Open the default realm.\nlet realm = try! Realm()\n\nvar token: NotificationToken?\n\nlet dog = Dog()\ndog.name = \"Max\"\n\n\u002F\u002F Create a dog in the realm.\ntry! realm.write {\n    realm.add(dog)\n}\n\n\u002F\u002F  Set up the listener & observe object notifications.\ntoken = dog.observe { change in\n    switch change {\n    case .change(let properties):\n        for property in properties {\n            print(\"Property '\\(property.name)' changed to '\\(property.newValue!)'\");\n        }\n    case .error(let error):\n        print(\"An error occurred: (error)\")\n    case .deleted:\n        print(\"The object was deleted.\")\n    }\n}\n\n\u002F\u002F Update the dog's name to see the effect.\ntry! realm.write {\n    dog.name = \"Wolfie\"\n}\n```\n### SwiftUI\nRealm integrates directly with SwiftUI, updating your views so you don't have to.\n```swift\nstruct ContactsView: View {\n    @ObservedResults(Person.self) var persons\n\n    var body: some View {\n        List {\n            ForEach(persons) { person in\n                Text(person.name)\n            }\n            .onMove(perform: $persons.move)\n            .onDelete(perform: $persons.remove)\n        }.navigationBarItems(trailing:\n            Button(\"Add\") {\n                $persons.append(Person())\n            }\n        )\n    }\n}\n```\n\n## Fully Encrypted\nData can be encrypted in-flight and at-rest, keeping even the most sensitive data secure.\n```swift\n\u002F\u002F Generate a random encryption key\nvar key = Data(count: 64)\n_ = key.withUnsafeMutableBytes { (pointer: UnsafeMutableRawBufferPointer) in\n    guard let baseAddress = pointer.baseAddress else {\n        fatalError(\"Failed to obtain base address\")\n    }\n    SecRandomCopyBytes(kSecRandomDefault, 64, baseAddress)\n}\n\n\u002F\u002F Add the encryption key to the config and open the realm\nlet config = Realm.Configuration(encryptionKey: key)\nlet realm = try Realm(configuration: config)\n\n\u002F\u002F Use the Realm as normal\nlet dogs = realm.objects(Dog.self).filter(\"name contains 'Fido'\")\n```\n\n## Getting Started\n\nWe support installing Realm via Swift Package Manager, CocoaPods, Carthage, or by importing a dynamic XCFramework.\n\nFor more information, see our [Quick Start](docs\u002Fguides\u002Fquick-start.md).\n\n## Documentation\n\nThe documentation can be found in the [docs\u002F](docs\u002FREADME.md) directory.\n\nThe API reference can be generated from source using\n[jazzy](https:\u002F\u002Fgithub.com\u002Frealm\u002Fjazzy\u002F) by running `sh build.sh docs` from the root of this repository.\n\n## Getting Help\n\n- **Need help with your code?**: Look for previous questions with the[`realm` tag](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Frealm?sort=newest) on Stack Overflow or [ask a new question](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Fask?tags=realm). For general discussion that might be considered too broad for Stack Overflow, use the [Community Forum](https:\u002F\u002Fdeveloper.mongodb.com\u002Fcommunity\u002Fforums\u002Ftags\u002Fc\u002Frealm-sdks\u002F58\u002Fswift\u002F).\n- **Have a bug to report?** [Open a GitHub issue](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-swift\u002Fissues\u002Fnew). If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.\n- **Have a feature request?** [Open a GitHub issue](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-swift\u002Fissues\u002Fnew). Tell us what the feature should do and why you want the feature.\n\n## Building Realm\n\nIn case you don't want to use the precompiled version, you can build Realm yourself from source.\n\nPrerequisites:\n\n* Building Realm requires Xcode 15.3 or newer.\n* Building Realm documentation requires [jazzy](https:\u002F\u002Fgithub.com\u002Frealm\u002Fjazzy)\n\nOnce you have all the necessary prerequisites, building Realm just takes a single command: `sh build.sh build`.\nYou'll need an internet connection the first time you build Realm to download the core binary.\nThis will produce Realm.xcframework and RealmSwift.xcframework in `build\u002FRelease\u002F`.\n\nRun `sh build.sh help` to see all the actions you can perform (build ios\u002Fosx, generate docs, test, etc.).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details!\n\n## Code of Conduct\n\nThis project adheres to the [MongoDB Code of Conduct](https:\u002F\u002Fwww.mongodb.com\u002Fcommunity-code-of-conduct).\nBy participating, you are expected to uphold this code. Please report\nunacceptable behavior to [community-conduct@mongodb.com](mailto:community-conduct@mongodb.com).\n\n## License\n\nRealm Objective-C & Realm Swift are published under the Apache 2.0 license.\nRealm Core is also published under the Apache 2.0 license and is available\n[here](https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-core).\n\n## Feedback\n\n**_If you use Realm and are happy with it, please consider sending out a tweet mentioning [@realm](https:\u002F\u002Ftwitter.com\u002Frealm) to share your thoughts!_**\n\n**_And if you don't like it, please let us know what you would like improved, so we can fix it!_**\n\n\u003Cimg style=\"width: 0px; height: 0px;\" src=\"https:\u002F\u002F3eaz4mshcd.execute-api.us-east-1.amazonaws.com\u002Fprod?s=https:\u002F\u002Fgithub.com\u002Frealm\u002Frealm-swift#README.md\">\n","Realm 是一个移动数据库，旨在替代Core Data和SQLite。其核心功能包括直观的对象导向数据模型，无需ORM即可简化开发流程，同时支持实时更新和离线使用，确保应用程序在无网络连接时也能正常工作。技术特点上，它为移动设备进行了优化，占用资源少，运行效率高，并且提供了对SwiftUI的直接支持，使得界面能够自动响应数据变化。适用于需要高效存储与访问本地数据的iOS、macOS、tvOS及watchOS应用开发场景，特别是那些注重性能和用户体验的应用。",2,"2026-06-11 03:28:10","top_topic"]