{"id":18060854,"url":"https://github.com/0xleif/applicationkit","last_synced_at":"2025-04-11T12:32:13.379Z","repository":{"id":213195958,"uuid":"733282898","full_name":"0xLeif/ApplicationKit","owner":"0xLeif","description":"🧰 Application Lifecycle and AppState Enhancements","archived":false,"fork":false,"pushed_at":"2023-12-21T02:02:17.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T08:51:19.459Z","etag":null,"topics":["apple","application","dependency-injection","ios","macos","observable","property-wrapper","published","state","state-management","swift","swiftui","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://0xleif.github.io/ApplicationKit/","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/0xLeif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["0xLeif"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-12-19T01:27:31.000Z","updated_at":"2024-01-14T23:44:18.000Z","dependencies_parsed_at":"2023-12-19T08:10:38.561Z","dependency_job_id":"649d4995-6a8a-4ed0-b4a0-6e26ab8e5fcd","html_url":"https://github.com/0xLeif/ApplicationKit","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"9428dc0040c1d8ab2ca071083db00eff9e6a3937"},"previous_names":["0xleif/applicationkit"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FApplicationKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FApplicationKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FApplicationKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLeif%2FApplicationKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xLeif","download_url":"https://codeload.github.com/0xLeif/ApplicationKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401987,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apple","application","dependency-injection","ios","macos","observable","property-wrapper","published","state","state-management","swift","swiftui","tvos","watchos"],"created_at":"2024-10-31T04:10:42.607Z","updated_at":"2025-04-11T12:32:13.338Z","avatar_url":"https://github.com/0xLeif.png","language":"Swift","funding_links":["https://github.com/sponsors/0xLeif"],"categories":[],"sub_categories":[],"readme":"# ApplicationKit\n\nApplicationKit is a Swift-based library that provides a rich set of tools for managing and working with application state. Building upon [AppState](https://github.com/0xLeif/AppState), it provides an additional layer of functionality to manage lifecycle notifications and state changes in applications.\n\n## Features\n\n- A streamlined approach to handling and observing different lifecycle notifications.\n- A simplified interface to run closures only once from anywhere within the codebase.\n- More to come...\n\n## Getting Started\n\n### Requirements\n\n- Swift 5.7 or later\n\n- iOS 15.0 or later\n- watchOS 8.0 or later\n- macOS 11.0 or later\n- tvOS 15.0 or later\n\n### Installation\n\nYou can integrate ApplicationKit into your project using Swift Package Manager.\n\nOnce you have your Swift package set up, adding ApplicationKit as a dependency is as easy as adding it to the dependencies value of your Package.swift file.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/0xLeif/ApplicationKit.git\", from: \"0.1.0\")\n]\n```\n\n## Usage\n\nTo handle various application states, override the necessary methods in your custom application class:\n\n```swift\nprivate class MyApplication: LifecyleApplication {\n    override var lifecycleNotifications: [LifecyleNotification] {\n        super.lifecycleNotifications + [\n            // Your additional lifecycle notifications\n        ]\n    }\n\n    /// Gets called when application state becomes active\n    override func didBecomeActiveNotification(notification: Notification) { \n        // Custom code implementation \n    }\n}\n```\n\nIn your App initialization, promote your custom application class:\n\n```swift\nApplication.promote(to: MyApplication.self)\n```\n\nUse ApplicationKit's `.runOnce` feature to run a specific closure code once within the lifecycle of the application:\n```swift\nApplication.runOnce { performExpensiveTaskHere() }\n```\n\n## Contributing\n\nPull requests are very welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\nApplicationKit is distributed under the MIT license. For more information, refer to the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fapplicationkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xleif%2Fapplicationkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xleif%2Fapplicationkit/lists"}