com.JafarH.UserDefaults 1.0.0

dotnet add package com.JafarH.UserDefaults --version 1.0.0
NuGet\Install-Package com.JafarH.UserDefaults -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="com.JafarH.UserDefaults" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add com.JafarH.UserDefaults --version 1.0.0
#r "nuget: com.JafarH.UserDefaults, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install com.JafarH.UserDefaults as a Cake Addin
#addin nuget:?package=com.JafarH.UserDefaults&version=1.0.0

// Install com.JafarH.UserDefaults as a Cake Tool
#tool nuget:?package=com.JafarH.UserDefaults&version=1.0.0

UserDefaults

Implementation of user defaults similar to Swift. Data are stored as key-value in a file in the application execution path.

Usage

You can create your own user default, but there is a standard user default that you can use as the default.

You can store data (string, integer and boolean) by using the Store method:

UserDefault.standard.Store(key: "MyKey", value: 100);

By using methods : GetObject, GetString, GetInteger and GetBoolean you will get your stored vales:

bool value = UserDefault.standard.GetBoolean(key: "MyKey0");
int value = UserDefault.standard.GetInteger(key: "MyKey1");
string value = UserDefault.standard.GetString(key: "MyKey2");
object value = UserDefault.standard.GetObject(key: "MyKey3");

Warning: Be careful that the keys used are unique, otherwise the data will be replaced.

Caution

- Data is stored as a file without any security.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 164 2/12/2023

First Release.