Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ node_modules/
venv/
*.pyc
.mypy_cache/

## Swift
xcuserdata/
1 change: 1 addition & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Here are the checklists for the various languages:
- [C++](cpp.md)
- [TypeScript](typescript.md)
- [Java](java.md)
- [Swift](swift.md)

By contributing to this repository you agree that all of your work will be governed by the terms of the [LICENSE](../LICENSE) file.

Expand Down
1 change: 1 addition & 0 deletions docs/directory-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ If you want to contribute to a language not listed here please add it to the lis
- `typescript/`
- `java/`
- `octave/`
- `swift/`

## [Directory `tools/`](../tools/)

Expand Down
7 changes: 7 additions & 0 deletions docs/swift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Swift Checklist

This is a checklist for contributing Swift example code to this repository.

## Tool & Runtime Versions

We recommend using the latest version of XCode or Swift Package Manager.
28 changes: 28 additions & 0 deletions examples/gui_swift_ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Simple GUI using SwiftUI

This example demonstrates using the [SwiftUI Framework](https://developer.apple.com/xcode/swiftui/)
to create a simple Interface to control a Zaber device.

<img src="img/screenshot.png" style="max-width:30rem;" alt="Screenshot">

## Hardware Requirements

Any Zaber linear motion device connected to a serial port.

## Dependencies / Software Requirements / Prerequisites

- MacOS 14.5+
- [XCode 16+](https://developer.apple.com/xcode/)

## Configuration / Parameters

The serial port to connect to can be entered into the input box after script startup.

Optionally, you can edit the following constants in the script before running the script:

- `DeviceConstants.deviceAddress`: The device address of the device you'd like to connect to
- `DeviceConstants.axisNumber`: The axis number of the axis you'd like to control on the device (`1` for most integrated devices)

## Running the Script

To run the script, open the project in XCode and press the `Start` button.
Loading