Wandkit introduction
Wandkit is a powerful framework designed to enhance your development experience with features such as screen sharing, debugging tools, real-time logging, and seamless integration with Nativeblocks Studio. This document provides a comprehensive guide to installing, configuring, and utilizing Wandkit and its components, including DevKit.
Get Started
Requirements
Make sure that your project meets these requirements:
- Uses Swift 5.0 or higher
- Uses SwiftUI for UI development
- Use iOS 15.0 or above
- Initialized Nativeblocks Core SDK
Install Wandkit
Add Wandkit to your project by updating your Package.swift:
.package(url: "https://github.com/nativeblocks/nativeblocks-wandkit-ios-sdk", from: "1.0.7")
DevKit
DevKit is a component of the Wandkit framework that provides development functionalities such as keeping the screen active, auto-connecting to the environment, and remote logging. It is specifically designed to work with the Nativeblocks Studio environment.
Initialize the SDK after Nativeblocks initialization. Use the Builder pattern for easier configuration:
Ensure DevKit is only used in debug builds by wrapping the code with #if DEBUG:
#if DEBUG
let devKit = DevKit.Builder()
.keepScreenOn()
.autoConnect()
.enableLogging()
.build()
NativeblocksManager.getInstance().wandKit(devKit)
#endif
Here is how to integrate DevKit in a SwiftUI app:
import SwiftUI
import Nativeblocks
import NativeblocksWandkit
@main
struct SampleApp: App {
init() {
NativeblocksManager.initialize(
...
)
#if DEBUG
let devKit = DevKit.Builder()
.keepScreenOn()
.autoConnect()
.enableLogging()
.build()
NativeblocksManager.getInstance().wandKit(devKit)
#endif
}
...
}