Instance Method

set(_:forKey:)

Sets the value of the specified default key to the specified integer value.

Declaration

func set(_ value: Int, forKey defaultName: String)

Parameters

value

The integer value to store in the defaults database.

defaultName

The key with which to associate the value.

Discussion

This is a convenience method for calling set(_:forKey:).

See Also

Setting Default Values

func set(Any?, forKey: String)

Sets the value of the specified default key.

func set(Float, forKey: String)

Sets the value of the specified default key to the specified float value.

func set(Double, forKey: String)

Sets the value of the specified default key to the double value.

func set(Bool, forKey: String)

Sets the value of the specified default key to the specified Boolean value.

func set(URL?, forKey: String)

Sets the value of the specified default key to the specified URL.