Skip to content
Max Cobb edited this page Dec 22, 2020 · 5 revisions

RealityUI

RealityUI is a collection of User Interface classes for RealityKit. The classes included in RealityUI aim to offer familiar User Interface guidelines, but in a 3D setting for Augmented and Virtual Reality through RealityKit.

The User Interface controls in this repository so far are made to be familiar to what people are used to with 2D interfaces, however the plan is to expand the tools on offer to new and unique controls, which are more appropriate for an Augmented Reality and Virtual Reality context.

Requirements

  • iOS 13 or macOS 10.15
  • Swift 5.2
  • Xcode 11

Content

Installation

Swift Package Manager

Add the URL of this repository to your Xcode 11+ Project under Project > Swift Packages.

https://github.com/maxxfrazer/RealityUI.git

Usage

Add import RealityUI to the top of your swift file to start.

Registering RealityUI Components

All components used in RealityUI must be registered before they are used, simply call RealityUI.registerComponents() anywhere in your app before any classes starting with RUI are initialised to avoid issues with that. For more information on what is meant by registering components see Apple's documentation here.

Activating Gestures

If you plan on using RUISwitch or RUIStepper, then you should at least enable .tap RUISlider uses .pan, but I would just recommend using .all to avoid issues, as these will inevitably move around ad RealityUI develops, and will not interfere with the rest of your RealityKit scene.

RealityUI.enableGestures(.all, on: arView)

Clone this wiki locally