Coder Social home page Coder Social logo

trendingtechnology / shortcuts-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a2/shortcuts-swift

0.0 2.0 0.0 1.15 MB

Write Shortcuts in Playgrounds

Home Page: https://github.com/a2/shortcuts-swift

License: MIT License

Ruby 11.95% Swift 88.05%

shortcuts-swift's Introduction

Banner

Shortcuts Swift

Build Status

Subscription feed link or click here on your iPad with Swift Playgrounds 2 installed.

Example

Warn for Low Battery Level

let batteryLevel = actionOutput()
let shortcut = buildShortcut(
    comment("This Shortcut was generated in Swift.") +
    getBatteryLevel().savingOutput(to: batteryLevel) +
    ifLessThan(20, ifTrue: (
        setLowPowerMode(true) +
        showResult("Your battery is at \(batteryLevel)%, you might want to charge it.")
    ), ifFalse: (
        showResult("Your battery is at \(batteryLevel)%, you're probably fine for now.")
    ))
)

Clap Along

let shortcut = buildShortcut(
    comment("This Shortcut was generated in Swift.") +
    ask(question: "WHAT ๐Ÿ‘ DO ๐Ÿ‘ YOU ๐Ÿ‘ WANT ๐Ÿ‘ TO ๐Ÿ‘ SAY") +
    changeCase(to: .uppercase) +
    replaceText("[\\s]", replaceWith: " ๐Ÿ‘ ", regularExpression: true) +
    chooseFromMenu(items: [
        ("Share", share()),
        ("Copy to Clipboard", copyToClipboard()),
    ])
)

Swift Package Manager

.package(url: "https://github.com/a2/shortcuts-swift", from: "1.0.0")

Contributing

Please read the Contributions Guide and the Code of Conduct before getting started. You will need Xcode 10 or newer to build the project.

Authors

Alexsander Akers and Alexis Aubry

License

Shortcuts Swift is available under the MIT license. See the LICENSE file for more info.

shortcuts-swift's People

Contributors

a2 avatar alexisakers avatar azure-pipelines[bot] avatar lennet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.