{"id":18239988,"url":"https://github.com/superturboryan/controlkit","last_synced_at":"2025-07-04T16:32:04.142Z","repository":{"id":259940201,"uuid":"879856945","full_name":"superturboryan/ControlKit","owner":"superturboryan","description":"📦 Swift Package providing simplified APIs for controlling device features","archived":false,"fork":false,"pushed_at":"2025-06-05T21:25:32.000Z","size":25,"stargazers_count":9,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T21:29:48.671Z","etag":null,"topics":["avfoundation","control","ios","iphone","playback-controls","swift","swift-package","volume-control"],"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/superturboryan.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":"2024-10-28T17:04:46.000Z","updated_at":"2025-06-03T16:32:22.000Z","dependencies_parsed_at":"2024-10-28T19:04:09.371Z","dependency_job_id":"1576e71e-709b-4b82-bfbd-cda97b4cb8bc","html_url":"https://github.com/superturboryan/ControlKit","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"105f28a3cab96e660ed2e74693d6d4013403a489"},"previous_names":["superturboryan/controlkit"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/superturboryan/ControlKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superturboryan%2FControlKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superturboryan%2FControlKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superturboryan%2FControlKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superturboryan%2FControlKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superturboryan","download_url":"https://codeload.github.com/superturboryan/ControlKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superturboryan%2FControlKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263577237,"owners_count":23483130,"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":["avfoundation","control","ios","iphone","playback-controls","swift","swift-package","volume-control"],"created_at":"2024-11-05T04:04:24.767Z","updated_at":"2025-07-04T16:32:04.117Z","avatar_url":"https://github.com/superturboryan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![ControlKit Light](https://github.com/user-attachments/assets/11ad00d7-a200-46bc-bc99-4b214131dfe7#gh-light-mode-only)\n![ControlKit Dark](https://github.com/user-attachments/assets/b0d1fa79-4b56-4fd1-bb5b-4a25c9e3254c#gh-dark-mode-only)\n\n# ControlKit\n\n**ControlKit** is a minimal Swift Package enabling control of media playback and device volume.  \n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsuperturboryan%2FControlKit%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/superturboryan/ControlKit) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsuperturboryan%2FControlKit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/superturboryan/ControlKit) ![Build Status](https://github.com/superturboryan/ControlKit/workflows/%F0%9F%A7%A9%20Build%20Package/badge.svg) ![Lint](https://github.com/superturboryan/ControlKit/workflows/%F0%9F%A7%B9%20Lint/badge.svg) ![Contributors](https://img.shields.io/github/contributors/superturboryan/ci-playground)\n\n### TLDR \n\nControl the device's volume with one line:  \n\n```swift\nControl.Volume.increase() // 🔊 🆙\n```\n\n## Installation\n\nAdd ControlKit as a dependency in your Xcode project:\n\n1. Go to **File \u003e Add Package Dependencies…**  \n\n2. Enter the package URL in the search bar:  \n\n```\nhttps://github.com/superturboryan/ControlKit.git\n```  \n\n3. Choose the libraries you want to include:  \n  \n![Screenshot 2024-10-28 at 17 46 50](https://github.com/user-attachments/assets/48e0a678-fd75-4056-9754-867a11b87d67)\n\n## Requirements\n\n[`SpotifyController`](Sources/Controllers/SpotifyController.swift) requires a Spotify _Client ID_ \nand _Redirect URL_ to authorize with \u0026 control the Spotify app.  \n\n1. [Define a custom URL scheme for your app](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app). \nAdd a `URL Type` to the target's `Info.plist`.\n\n2. Create an app in the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) \nto get a _client ID_ and register your _redirect URL_ (scheme).\n\n\u003cimg width=\"1007\" alt=\"Screenshot 2024-10-29 at 17 31 24\" src=\"https://github.com/user-attachments/assets/895c8092-4a9d-4526-9f85-5da7b868fbc1\"\u003e\n\n### Warning 👇\n\nThe Spotify access token is **not persisted across app launches** by default. \n\nYou must provide an object conforming to **`DAO\u003cString\u003e`** if you want the access token to be persisted.\n\n## Usage\n\n### Control\n\n```swift\nimport Control\n\n// 🔊 Decrement system volume\nControl.Volume.decrease()\n\n// 🕵️‍♂️ Check if audio is being played (by another app)\nif Control.Playback.isAudioPlaying { \n    // 💃🕺 \n}\n\n// ⏭️ Skip to next track (Apple Music only - use Controllers.SpotifyController for Spotify 💚)\nControl.Playback.AppleMusic.skipToNextTrack()\n\n// 🫨 Vibrate\nControl.Haptics.vibrate()\n```\n\n### Controllers\n\n```swift\n// App.swift\n\nimport Controllers\nimport SwiftUI\n\n@main struct YourApp: App {\n\n    @StateObject var spotify = SpotifyController(\n        config: .init(\n            clientID: Secrets.clientID,\n            redirectURL: \"controlkit://spotify\"\n        )\n    )\n    \n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n            .environmentObject(spotify)\n            .onOpenURL { spotify.setAccessToken(from: $0) } // Parse access token from URL\n        }\n    }\n    \n    func skipToNextSpotifyTrack() {\n        spotify.skipToNextTrack()\n    }\n}\n\n// Secrets.swift 🔐\n// Don't forget to gitignore this 🙈\nenum Secrets {\n    static let clientID = \"\u003cyour client id\u003e\"\n}\n```\n\n## Dependencies\n\n📚 [AVFAudio](https://developer.apple.com/documentation/avfaudio)  \n📚 [Media Player](https://developer.apple.com/documentation/mediaplayer/)    \n📦 [SpotifyiOS](https://github.com/spotify/ios-sdk)  \n\n## Contributing\n\nContributions and feedback are welcome! 🧑‍💻👩‍💻  \n\nHere are a few guidelines:\n\n- You can [open an Issue](https://github.com/superturboryan/ControlKit/issues/new) or raise a PR 🤝\n- Commit messages should contain emojis ❤️ and be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) 🔏\n- [Workflows](https://github.com/superturboryan/ControlKit/actions) should be green 🟢\n- `main` should be [linear](https://stackoverflow.com/questions/20348629/what-are-the-advantages-of-keeping-linear-history-in-git) 🎋 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperturboryan%2Fcontrolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperturboryan%2Fcontrolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperturboryan%2Fcontrolkit/lists"}