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.
DevKit
public final class DevKit: Wandkit
Inheritance
Wandkit
Builder
DevKit uses the Builder pattern for configuration. Initialize using DevKit.Builder().
public class Builder {
public func keepScreenOn() -> Builder
public func autoConnect() -> Builder
public func enableLogging() -> Builder
public func build() -> DevKit
}
Builder Methods
keepScreenOn()
Enables the keep screen on feature. When enabled, the device screen will stay on and won't auto-lock.
public func keepScreenOn() -> Builder
Returns: The builder instance for method chaining.
autoConnect()
Enables automatic connection to the development environment. When enabled, the SDK will automatically connect to Nativeblocks Studio on startup.
public func autoConnect() -> Builder
Returns: The builder instance for method chaining.
enableLogging()
Enables remote logging to Nativeblocks Studio. When enabled, application logs will be sent to Studio for debugging.
public func enableLogging() -> Builder
Returns: The builder instance for method chaining.
build()
Builds and returns the configured DevKit instance.
public func build() -> DevKit
Returns: A new DevKit instance with the configured options.
destroy()
Destroys the DevKit instance and cleans up resources.
public func destroy()
Note: If keepScreenOn is enabled, the screen lock will be re-enabled.
Sample Usage
import Foundation
import Nativeblocks
import NativeblocksWandkit
NativeblocksManager.initialize()
#if DEBUG
let devKit = DevKit.Builder()
.keepScreenOn()
.autoConnect()
.enableLogging()
.build()
NativeblocksManager.getInstance().wandKit(devKit)
#endif