ARViewerModular is a modular and extensible framework designed to simplify the development of ARKit-based applications. The framework supports the visualization of 3D objects, integration with Vision for environment recognition, and flexibility to handle various use cases such as decoration, museums, or games.
- Modular Plugin System: Add or remove functionalities seamlessly.
- Customizable AR Modes: Adapt the AR experience to different use cases.
- Vision Integration: Recognize and interact with real-world environments.
- SwiftUI Compatibility: Extend and customize the user interface effortlessly.
- Persistence Support: Save and load configurations and states.
- iOS 16.0 or later
- Xcode 15.0 or later
- Swift 5.8 or later
- ARKit and Vision frameworks enabled
- Clone the repository:
git clone https://github.com/yourusername/ARViewerModular.git
- Open the project in Xcode:
cd ARViewerModular open ARViewerModular.xcodeproj
- Build and run the project on a real device with ARKit support.
Create a custom plugin by conforming to the ARPlugin
protocol:
public class HighlightPlugin: ARPlugin {
public let name = "Highlight Plugin"
public let description = "Highlights objects in the AR scene."
public func activate(for view: ARSCNView) {
// Add highlighting logic here
}
public func deactivate() {
// Clean up resources
}
}
Register and activate your plugin:
let plugin = HighlightPlugin()
PluginManager.shared.registerPlugin(plugin)
PluginManager.shared.activatePlugin(named: "Highlight Plugin", for: arView)
Define a new mode by implementing the ARMode
protocol:
public class CustomMode: ARMode {
public let name = "Custom Mode"
public let description = "A unique AR experience."
public func configureScene(for view: ARSCNView) {
// Customize your AR scene here
}
}
Activate the mode:
ModeManager.shared.activateMode(CustomMode(), for: arView)
- Plugin System: Extend functionality with modular plugins.
- Mode Manager: Switch between different AR scenarios seamlessly.
- Persistence Manager: Save and retrieve configurations using a simple protocol.
- SwiftUI Integration: Use customizable views like
ARToolbar
for interactive interfaces.
We welcome contributions to ARViewerModular! Please follow the steps below:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/YourFeatureName
- Commit your changes:
git commit -m "Add YourFeatureName"
- Push to the branch:
git push origin feature/YourFeatureName
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Apple ARKit and Vision documentation.
- Inspiration from modular design patterns in iOS development.
- Add support for advanced features like multi-user AR sessions.
- Expand the plugin and mode library to include more use cases.
- Improve testing coverage with XCTest for plugins and modes.