{"id":22903129,"url":"https://github.com/dungntm58/ioscore","last_synced_at":"2026-02-01T21:02:36.700Z","repository":{"id":90288538,"uuid":"193823495","full_name":"dungntm58/iOSCore","owner":"dungntm58","description":"An architecture, util modules and declarative table view/collection view and so on","archived":false,"fork":false,"pushed_at":"2025-09-23T19:31:10.000Z","size":828,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-23T21:23:02.542Z","etag":null,"topics":["clean-architecture","clean-code","combine","declarative-programming","ios","mobile-development","reactive-programming","redux","rxswift","swift"],"latest_commit_sha":null,"homepage":"","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/dungntm58.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-26T03:32:27.000Z","updated_at":"2024-06-26T22:18:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"feb2de14-96b6-4aa0-9ac8-144b84096f4c","html_url":"https://github.com/dungntm58/iOSCore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dungntm58/iOSCore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dungntm58%2FiOSCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dungntm58%2FiOSCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dungntm58%2FiOSCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dungntm58%2FiOSCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dungntm58","download_url":"https://codeload.github.com/dungntm58/iOSCore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dungntm58%2FiOSCore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28990694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T20:57:35.821Z","status":"ssl_error","status_checked_at":"2026-02-01T20:57:29.580Z","response_time":56,"last_error":"SSL_read: 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":["clean-architecture","clean-code","combine","declarative-programming","ios","mobile-development","reactive-programming","redux","rxswift","swift"],"created_at":"2024-12-14T02:34:05.383Z","updated_at":"2026-02-01T21:02:36.695Z","avatar_url":"https://github.com/dungntm58.png","language":"Swift","readme":"# iOS Core\n\nA comprehensive Swift framework for iOS development featuring scene-based architecture, dependency injection, and powerful macro-based code generation.\n\n[![Swift](https://img.shields.io/badge/Swift-6.2-orange.svg)](https://swift.org)\n[![Platform](https://img.shields.io/badge/Platform-iOS%2013%2B%20%7C%20tvOS%2013%2B%20%7C%20macOS%2010.15%2B-blue.svg)](https://developer.apple.com)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n## Overview\n\niOS Core provides a modern, Swift Concurrency-based architecture for iOS apps with:\n\n- **Scene-Based Architecture**: Manage app flow with Scene protocol and automatic lifecycle management\n- **Dependency Injection**: Type-safe dependency injection with automatic scene association\n- **Swift Macros**: Reduce boilerplate with `@Scene`, `@SceneDependency`, and `@AsyncInit` macros\n- **Repository Pattern**: Clean architecture with local/remote data management\n- **Redux Integration**: State management with Combine-based Redux implementation\n- **Data Persistence**: Core Data and Realm integration\n\n## Requirements\n\n- **iOS 13.0+** / tvOS 13.0+ / macOS 10.15+\n- **Swift 6.2+**\n- **Xcode 15.0+**\n\n## Installation\n\n### Swift Package Manager\n\nAdd this package to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/dungntm58/iOSCore.git\", from: \"1.0.0\")\n]\n```\n\nOr add it through Xcode: **File → Add Package Dependencies** and enter the repository URL.\n\n## Architecture\n\n### Scene-Based Architecture\n\nThe core of the framework is the Scene protocol, which represents a unit of app functionality:\n\n```swift\nimport CoreMacros\nimport CoreBase\n\n@Scene\nactor LoginScene {\n    @SceneDependency var authService: AuthService\n    @AsyncInit var viewModel = LoginViewModel()\n\n    func perform(with userInfo: Any?) async {\n        // Scene logic here\n        if await authService.isAuthenticated() {\n            await switch(to: DashboardScene(), with: nil)\n        }\n    }\n}\n```\n\n### Dependency Injection\n\nDependencies are automatically resolved and associated with their owning scene:\n\n```swift\n@SceneDependency\nclass AuthService {\n    func authenticate(username: String, password: String) async -\u003e Bool {\n        // Can access the owning scene through `scene` property\n        return true\n    }\n}\n```\n\n### Scene Views with Dependency References\n\nViews can reference scene dependencies through the `@SceneDependencyReference` macro:\n\n```swift\nimport SwiftUI\nimport CoreMacros\n\n@SceneView\nstruct LoginView: View {\n    @SceneDependencyReference var authService: AuthService?\n\n    var body: some View {\n        // Use authService here\n    }\n}\n```\n\n### Async Initialization\n\nHandle async initialization cleanly with the `@AsyncInit` macro:\n\n```swift\n@AsyncInit var expensiveResource = await SomeExpensiveResource.create()\n```\n\n## Available Modules\n\n### Core Modules\n\n- **CoreBase**: Scene architecture and base utilities\n- **CoreMacros**: Swift macros for reducing boilerplate\n- **CoreMacroProtocols**: Protocols and types for macro system\n\n### Repository \u0026 Data\n\n- **CoreRepository**: Repository pattern implementation\n- **CoreRepositoryLocal**: Local data repository support\n- **CoreRepositoryRemote**: Remote API repository support\n- **CoreRepositoryRequest**: HTTP request handling with Alamofire\n- **CoreDataStore**: Core Data integration\n- **CoreRealmDataStore**: Realm database integration\n\n### State Management\n\n- **CoreRedux**: Redux pattern with Combine\n- **CoreReduxList**: List-specific Redux utilities\n\n### Additional Features\n\n- **CoreAPNS**: Push notification handling\n\n## Quick Start\n\n### 1. Create a Scene\n\n```swift\nimport CoreMacros\nimport CoreBase\n\n@Scene\nactor WelcomeScene {\n    func perform(with userInfo: Any?) async {\n        print(\"Welcome scene is active!\")\n\n        // Navigate to next scene after 2 seconds\n        try? await Task.sleep(nanoseconds: 2_000_000_000)\n        await switch(to: LoginScene(), with: nil)\n    }\n}\n```\n\n### 2. Set up App Delegate\n\n```swift\nimport UIKit\nimport CoreBase\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    var window: UIWindow?\n    private lazy var launcher: Launchable = WelcomeScene()\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        window = UIWindow(frame: UIScreen.main.bounds)\n        window?.rootViewController = UIViewController()\n        window?.makeKeyAndVisible()\n\n        Task { @MainActor in\n            await launcher.launch()\n        }\n\n        return true\n    }\n}\n```\n\n### 3. Create Dependencies\n\n```swift\n@SceneDependency\nclass NetworkService {\n    func fetchData() async -\u003e Data? {\n        // Network implementation\n        return nil\n    }\n}\n\n@Scene\nactor DataScene {\n    @SceneDependency var networkService: NetworkService\n\n    func perform(with userInfo: Any?) async {\n        let data = await networkService.fetchData()\n        // Process data...\n    }\n}\n```\n\n## Advanced Features\n\n### Manual Scene Preparation\n\nIf you implement custom scene methods, the macro will provide compiler warnings with instructions:\n\n```swift\n@Scene\nactor CustomScene {\n    @SceneDependency var service: MyService\n\n    // Manual implementation - you'll get a compiler warning to call __setupSceneDependencies()\n    func prepareSelf() async {\n        await __setupSceneDependencies()  // Associate dependencies\n        // Your custom preparation logic\n    }\n}\n```\n\n### ViewManager Integration\n\nScenes can automatically conform to `HasViewManagable` when they have ViewManager properties:\n\n```swift\n@Scene\nactor MyScene {\n    @SceneDependency var viewManager: MyViewManager  // ViewManager conforms to ViewManagable\n\n    // Automatically generates anyViewManager property\n}\n```\n\n### Repository Pattern Example\n\n```swift\nimport CoreRepository\nimport CoreRepositoryRemote\n\nstruct UserRepository: RemoteRepository {\n    typealias Entity = User\n\n    func fetch(byId id: String) async throws -\u003e User? {\n        // Remote fetch implementation\n    }\n}\n```\n\n## Macro Reference\n\n### `@Scene`\n- Generates Scene protocol conformance\n- Creates dependency resolution system\n- Provides lifecycle method implementations\n- Handles ViewManager integration\n\n### `@SceneDependency`\n- Marks types as scene dependencies\n- Generates SceneDependency protocol conformance\n- Enables automatic scene association\n\n### `@SceneDependencyReference`\n- Used in views to reference scene dependencies\n- Generates async getters that resolve through scene\n- Validates SceneReferencing conformance\n\n### `@AsyncInit`\n- Handles async property initialization\n- Generates Task-based initialization pattern\n- Works with both optional and non-optional properties\n\n### `@SceneView`\n- Marks views that reference scene dependencies\n- Provides SceneReferencing conformance\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\n**Robert Nguyen** - [dungntm58](https://github.com/dungntm58)\n\n---\n\nFor more detailed documentation and examples, check out the [Example project](Example/) included in this repository.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdungntm58%2Fioscore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdungntm58%2Fioscore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdungntm58%2Fioscore/lists"}