Preference

public struct Preference : Codable, Equatable
extension Preference: UpdateProfileChallengeAttribute

Struct representing Preference related values.

  • id

    Value representing the entity id.

    Declaration

    Swift

    public var id: Int
  • The name of preference.

    Declaration

    Swift

    public var name: String
  • The label of preference.

    Declaration

    Swift

    public var label: String
  • The description of preference.

    Declaration

    Swift

    public var desc: String
  • The list of domains.

    Declaration

    Swift

    public var domains: [String]
  • The list of domains with details.

    Declaration

    Swift

    public var detailedDomains: [Preference.Domain]
  • The list of domains selected by the user.

    Declaration

    Swift

    public var selectedDomain: [String]
  • The list of domains selected by the user.

    Declaration

    Swift

    public var userDomains: [String]
  • The list of domains added by the user.

    Declaration

    Swift

    public var addedDomains: [String]
  • Indicates if domains are unbounded or not.

    Declaration

    Swift

    public var isUnbounded: Bool
  • Indicates if domain to be selected is one or many.

    Declaration

    Swift

    public var isMultiSelect: Bool
  • Indicates whether the preference has only “yes” and “no” options

    Declaration

    Swift

    public var isToggle: Bool { get }
  • Indicates domains contain “no”

    Declaration

    Swift

    public var hasNoOption: Bool { get }
  • Indicates domains contain “yes”

    Declaration

    Swift

    public var hasYesOption: Bool { get }
  • Indicates if selectedDomains contain “yes”

    Declaration

    Swift

    public var hasSelectedYes: Bool { get }
  • Undocumented

    Declaration

    Swift

    public init(id: Int, name: String, label: String, desc: String, domains: [String],
                detailedDomains: [Preference.Domain], selectedDomain: [String], userDomains: [String],
                addedDomains: [String], isUnbounded: Bool, isMultiSelect: Bool)
  • Struct representing Preference Domain related values.

    See more

    Declaration

    Swift

    public struct Domain : Codable, Equatable
  • Checks if a given domain is contained in the selectedDomains or domains

    Declaration

    Swift

    public func checkIfDomainsContain(string: String, isSelected: Bool) -> Bool
  • Checks if a given domain is contained in the selectedDomains

    Declaration

    Swift

    public func hasSelected(domain: String) -> Bool
  • Checks if a given domain is contained in the userDomains

    Declaration

    Swift

    public func isDomainUserDefined(_ domain: String) -> Bool
  • Add/removes domain in selectedDomains

    Declaration

    Swift

    public mutating func toggleSelectionFor(domain: String)
  • Adds the given domain in the domains and userDomains

    Declaration

    Swift

    public mutating func addUserDomain(_ domain: String)
  • Removes the given domain in the domains, userDomains and selectedDomain

    Declaration

    Swift

    public mutating func removeUserDomain(_ domain: String)
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public init(from decoder: Decoder) throws