Code Monkey home page Code Monkey logo

windows-samples's Introduction

Swift on Windows Samples Apps

Sample apps for Swift on Windows, showcasing how to build Windows Apps using the Windows App SDK through the Swift/WinRT language projection.

Setup

Requirements

  1. Install latest Swift SDK from https://www.swift.org/download/
  2. Install latest CMake: winget install --id Kitware.CMake
  3. Windows SDK 10.0.20348.0: https://go.microsoft.com/fwlink/?linkid=2164145
  4. Visual Studio Community with C++ build tools

VSCode

VSCode is the editor of choice for developing Windows apps on Swift. You can install it from https://code.visualstudio.com/download.

If you choose to use Visual Studio Code, you'll need to install these extensions:

Building

The build of the Windows applications is done through a combination of CMake and SPM. The CMake portion of the build handles tasks that SPM currently doesn't support. The CMake configure step is responsible for restoring NuGet packages and generating the Swift/WinRT bindings.

Each sample application has it's own top-level directory in this repo. You can open the corresponding .code-workspace file in VSCode for the sample and build using Terminal->Run Build Task... or by pressing Ctrl+Shift+B.

If you'd prefer command line builds, you can first run the configure step of the build (cmake --preset debug) before running cmake --build --preset debug.

Application Setup / Running the Application

In order to use the WindowsAppSDK in a Swift application, there are files that need to be copied next to the .exe file itself, which isn't something SPM supports. The WindowsApplicationSetup.cmake file handles all of this as part of a post-build step. These files, along with the .exe itself, are copied to the build\bin folder of the repo. You can run the application from there.

Debugging in VSCode

Debugging in VSCode is supported through LLDB. You can simply press F5 or navigate to the Run and Debug (Ctrl+Shift+D) pane.

windows-samples's People

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.