package com.tt.honeyDue.storage

import platform.Foundation.NSUserDefaults

/**
 * iOS implementation of biometric preference storage using NSUserDefaults.
 * Follows the same pattern as ThemeStorageManager.ios.kt.
 */
actual class BiometricPreferenceManager {
    private val defaults = NSUserDefaults.standardUserDefaults

    actual fun isBiometricEnabled(): Boolean {
        return defaults.boolForKey(KEY_BIOMETRIC_ENABLED)
    }

    actual fun setBiometricEnabled(enabled: Boolean) {
        defaults.setBool(enabled, forKey = KEY_BIOMETRIC_ENABLED)
        defaults.synchronize()
    }

    companion object {
        private const val KEY_BIOMETRIC_ENABLED = "biometric_enabled"

        private val instance by lazy { BiometricPreferenceManager() }

        fun getInstance(): BiometricPreferenceManager = instance
    }
}
