package cl.homelogic.platform.common.settings

import com.russhwolf.settings.NSUserDefaultsSettings
import com.russhwolf.settings.Settings
import platform.Foundation.NSUserDefaults

class IOSSettingsFactory : ISettingsFactory {
    override fun createSettings(name: String?): Settings {
        val userDefaults = if (name != null) {
            NSUserDefaults(suiteName = name)
        } else {
            NSUserDefaults.standardUserDefaults
        }
        return NSUserDefaultsSettings(userDefaults)
    }
}
