Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

uxcam/ios-swiftui

Repository files navigation

⚠️ Deprecated ⚠️

This repository is deprecated and will no longer be supported for future SDK versions. Please migrate to our newer repository at uxcam-ios-swiftui.

UXCam-SwiftUI

This package is the framework for the UXCam SwiftUI wrapper. It depends on the main UXCam framework, v3.4.3 or higher.

Internally it uses some of the ideas in the Introspect library, but that library itself is not included here.

Using SwiftUI with UXCam

Starting the UXCam library

Add an init method to your main App struct.

Call UXCamSwiftUI.start(with: UXCamSwiftUI.Configuration) with your configuration to start the UXCam SDK in SwiftUI mode. NB: The configuration option enableAutomaticScreenNameTagging defaults to false in the UXCamSwiftUI library as manual screen tagging is required in SwiftUI.

eg.

	init()
	{
		UXCamCore.optIntoSchematicRecordings()
		let config = UXCamSwiftUI.Configuration(appKey: "YOUR APP KEY")
		UXCamSwiftUI.start(with: config)
	}

To call a completion block when the UXCam session verify completes use:
UXCamSwiftUI.start(with: UXCamSwiftUI.Configuration, sessionStarted: ((Bool) -> ())? = nil) - the flag indicates if a session started or not

Screen name tagging

Due to the nature of SwiftUI the automatic screen name tagging in UXCam for UIKit is not available.

To name screens use func uxcamTagScreenName(_ screenName: String) -> some View on the View

eg.

var body: some View
{
	Text("Hello world")
		.uxcamTagScreenName("HelloScreen")
}

Sensitive view hiding

Use func uxcamOcclude() -> some View on a view to hide it from screen recording. By default gestures will not be captured in sensitve views, to capture gestures use .uxcamOcclude(blockGestures: false)

eg.

var body: some View  
{  
	VStack
	{
		Text("Personal data: XYZ")  
	 		.uxcamOcclude()  

		Text("Personal data: Gestures seen")  
			.uxcamOcclude(blockGestures: false)
	}
}  

About

This is a wrapper on top of the native iOS UXCam SDK for improved SwiftUI capture

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •