Profiles

@available(*, deprecated, message: "This does not work on Skyle 3")
public class Profiles : ObservableObject

Profiles exposes Skyles User Profiles API which makes it possible to create, update, select and delete profiles. It also provides Publisher which hold the currently selected profile and a list of all profiles.

  • A reference to the current client, which represents the gRPC connection. This is automatically updated by ET when a new connection is established. In this case all Profiles are updated when this is updated.

    Declaration

    Swift

    internal var client: Skyle_SkyleNIOClient? { get set }
  • Internal empty constructor

    Declaration

    Swift

    internal init()
  • Internal constructor passing a possible client

    Declaration

    Swift

    internal init(_ client: Skyle_SkyleNIOClient?)
  • The state property exposes a Publisher which indicates the state of streaming of profiles.

    Declaration

    Swift

    @Published
    private(set) public var state: States { get set }
  • The profiles property exposes a Publisher which holds an array of Profile objects pulled from Skyle.

    Declaration

    Swift

    @Published
    private(set) public var profiles: [Profile] { get set }
  • The currentProfile property exposes a Publisher which indicates the currently active Profile.

    Declaration

    Swift

    @Published
    private(set) public var currentProfile: Profile? { get set }
  • Gets all profiles and the currently active Profile stored on Skyle asyncronously, updating the state, profiles and currentProfile properties.

    • completion: A completion handler
    • profile: The currently active Profile.
    • state: A ET.States containing possible errors.

    Declaration

    Swift

    public func get(completion: @escaping (_ profile: ET.Profile?, _ state: ET.States) -> Void = {_, _ in})
  • Creates or updates a Profile and sets it to the currently active one.

    • profile: The profile to be created, updated and set to currently active.
    • completion: A completion handler
    • profile: The new, active Profile.
    • state: A ET.States containing possible errors.

    Declaration

    Swift

    public func set(_ profile: ET.Profile, completion: @escaping (_ profile: ET.Profile?, _ state: ET.States) -> Void = {_, _ in})
  • Deletes a Profile.

    • profile: The profile to be deleted.
    • completion: A completion handler.
    • profile: The currently active Profile.
    • state: A ET.States containing possible errors.

    Declaration

    Swift

    public func delete(_ profile: ET.Profile, completion: @escaping (_ profile: ET.Profile?, _ state: ET.States) -> Void = {_, _ in})