A simple AR ruler app can measure length & area, built with SwiftUI + ARKit
- Swift 5.0+
- iOS 15.0+
- Xcode 26.0+
- An ARKit capable device (A9+) to run the AR measurement
- SwiftUI app lifecycle (
RulerApp) with the UI entirely in SwiftUI (ContentView,SettingView) ARSCNViewis embedded viaUIViewRepresentable(ARViewContainer) and the AR measurement logic lives in a single observableMeasurementModel- SceneKit measuring nodes (
LineNode,LineSetNode,FocusSquare,Plane) are shared model/view-logic - The old OpenCV dependency was replaced by a pure Swift plane fitting implementation,
and ARKit usage uses the modern
ARRaycastQuerybased API
- Mesure Length
videoplayback.mp4
- Mesure Area
videoplayback-2.mp4
-
AppStore (recommend)
-
Manually compile
git clone https://github.com/TBXark/Ruler- Open
Ruler.xcodeprojwith Xcode and build
This project has no external dependencies — everything is managed natively by Xcode / Swift Package Manager.
The old OpenCV (CocoaPods) dependency was replaced by a pure Swift plane fitting implementation, and deprecated
ARKit APIs were migrated to the modern ARRaycastQuery based API.
To regenerate the Xcode project, install XcodeGen and run xcodegen generate.
- 1.1.0 New UI design
We would love for you to contribute to Ruler, check the LICENSE file for more info.
ARuler Mesure distance using apple ARKit
TBXark – @tbxark – tbxark@outlook.com
Distributed under the MIT license. See LICENSE for more information.
