Skip to main content

Overview

The Synheart Behavior Swift/iOS SDK captures digital interaction events on-device — the eight BehaviorEventType cases are scroll, tap, swipe, appSwitch, notification, call, typing, and clipboard — and aggregates them into per-session summaries. Behavior is content-free — no text, no screen content, no PII. The SDK is an input layer: it produces events and session summaries. Higher-level human-state inference (focus, distraction, HSI fusion) is performed downstream by Synheart Core when behavior is fed into it.

Installation

Swift Package Manager

Add to your Package.swift or in Xcode (File → Add Packages…):

Requirements

  • iOS 12.0+
  • Swift 5.0+
  • Xcode 12.0+

Quick Start

Typing: clipboard and correction rates

The typing session summary includes clipboardActivityRate and correctionRate, derived from backspace/copy/paste/cut event counts emitted by the SDK.
  • Backspace/correction: Inferred from text length decrease. Cut is not counted as backspace.
  • Copy/paste/cut: The SDK does not observe the system clipboard. Call:
    • behavior.recordCopy()
    • behavior.recordPaste()
    • behavior.recordCut()
    when the user performs those actions (e.g. from a custom UITextField/UITextView that overrides copy(_:), paste(_:), cut(_:)). The Example app uses BehaviorTrackingTextField for this.

Event behavior

  • Taps and long press: Not counted when a text field or text view is first responder (keyboard open), so typing is not double-counted as taps.
  • Typing events: Include speed, cadence, burstiness, cadence variability, gap ratio, activity ratio, and backspace/copy/paste/cut counts.

API summary

Resources