FirebaseAuth Framework Reference

AuthStateChangesSequence

@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
struct AuthStateChangesSequence : AsyncSequence, @unchecked Sendable

An AsyncSequence that emits User? values whenever the authentication state changes.

This struct is the concrete type returned by the Auth.authStateChanges property.

  • Declaration

    Swift

    public typealias Element = User?
  • Declaration

    Swift

    @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
    public typealias Failure = Never
  • Declaration

    Swift

    public typealias AsyncIterator = Iterator
  • Creates a new sequence for monitoring authentication state changes.

    Declaration

    Swift

    public init(_ auth: Auth)

    Parameters

    auth

    The Auth instance to monitor.

  • Creates and returns an iterator for this asynchronous sequence.

    Declaration

    Swift

    public func makeAsyncIterator() -> Iterator

    Return Value

    An Iterator for AuthStateChangesSequence.

  • The asynchronous iterator for AuthStateChangesSequence.

    Declaration

    Swift

    public struct Iterator : AsyncIteratorProtocol
    extension Auth.AuthStateChangesSequence.Iterator: Sendable