{"id":13908199,"url":"https://github.com/a2/shortcuts-swift","last_synced_at":"2025-07-18T07:30:40.401Z","repository":{"id":50557464,"uuid":"162893700","full_name":"a2/shortcuts-swift","owner":"a2","description":"Write Shortcuts in Playgrounds","archived":true,"fork":false,"pushed_at":"2020-07-03T20:37:18.000Z","size":1179,"stargazers_count":131,"open_issues_count":4,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-25T17:45:58.429Z","etag":null,"topics":["ios","ios-12","playground-book","shortcuts","workflow"],"latest_commit_sha":null,"homepage":"https://github.com/a2/shortcuts-swift","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/a2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-23T13:36:05.000Z","updated_at":"2024-04-11T02:49:00.000Z","dependencies_parsed_at":"2022-09-07T07:51:32.733Z","dependency_job_id":null,"html_url":"https://github.com/a2/shortcuts-swift","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/a2/shortcuts-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fshortcuts-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fshortcuts-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fshortcuts-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fshortcuts-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a2","download_url":"https://codeload.github.com/a2/shortcuts-swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fshortcuts-swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265720365,"owners_count":23817218,"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":["ios","ios-12","playground-book","shortcuts","workflow"],"created_at":"2024-08-06T23:02:32.640Z","updated_at":"2025-07-18T07:30:39.912Z","avatar_url":"https://github.com/a2.png","language":"Swift","funding_links":[],"categories":["HarmonyOS","Swift"],"sub_categories":["Windows Manager"],"readme":"*This repository has been replaced with [SwiftShortcuts](https://github.com/a2/swift-shortcuts), and is archived for reference.*\n\n![Banner](https://raw.githubusercontent.com/a2/shortcuts-swift/master/banner.png)\n\n# Shortcuts Swift\n\n[![Build Status](https://dev.azure.com/pandamonia/shortcuts-swift/_apis/build/status/a2.shortcuts-swift?branchName=master)](https://dev.azure.com/pandamonia/shortcuts-swift/_build/latest?definitionId=3?branchName=master)\n\n[Subscription feed link](https://raw.githubusercontent.com/a2/shortcuts-swift/master/feed.json) or click [here](https://developer.apple.com/ul/sp0?url=https://raw.githubusercontent.com/a2/shortcuts-swift/master/feed.json) on your iPad with Swift Playgrounds 2 installed.\n\n## Example\n\n### Warn for Low Battery Level\n\n```swift\nlet batteryLevel = actionOutput()\nlet shortcut = buildShortcut(\n    comment(\"This Shortcut was generated in Swift.\") +\n    getBatteryLevel().savingOutput(to: batteryLevel) +\n    ifLessThan(20, ifTrue: (\n        setLowPowerMode(true) +\n        showResult(\"Your battery is at \\(batteryLevel)%, you might want to charge it.\")\n    ), ifFalse: (\n        showResult(\"Your battery is at \\(batteryLevel)%, you're probably fine for now.\")\n    ))\n)\n```\n\n### Clap Along\n\n```swift\nlet shortcut = buildShortcut(\n    comment(\"This Shortcut was generated in Swift.\") +\n    ask(question: \"WHAT 👏 DO 👏 YOU 👏 WANT 👏 TO 👏 SAY\") +\n    changeCase(to: .uppercase) +\n    replaceText(\"[\\\\s]\", replaceWith: \" 👏 \", regularExpression: true) +\n    chooseFromMenu(items: [\n        (\"Share\", share()),\n        (\"Copy to Clipboard\", copyToClipboard()),\n    ])\n)\n```\n## Swift Package Manager\n\n```swift\n.package(url: \"https://github.com/a2/shortcuts-swift\", from: \"1.0.0\")\n```\n\n## Contributing\n\nPlease read the [Contributions Guide](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md) before getting started. You will need Xcode 10 or newer to build the project.\n\n## Authors\n\n[Alexsander Akers](https://github.com/a2) and [Alexis Aubry](https://github.com/alexaubry)\n\n## License\n\nShortcuts Swift is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2%2Fshortcuts-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa2%2Fshortcuts-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2%2Fshortcuts-swift/lists"}