UserDefaultsMonitor

public class UserDefaultsMonitor : BaseNotificationMonitor

A UserDefaultsMonitor instance monitors a user defaults object for changes to its data.

  • Encapsulates changes to the user defaults object.

    See more

    Declaration

    Swift

    public enum Event
  • Specifies which events to monitor.

    See more

    Declaration

    Swift

    public struct Options : OptionSet
  • Initializes a new UserDefaultsMonitor.

    Declaration

    Swift

    public init(userDefaults: UserDefaults,
                options: Options = .all,
                queue: OperationQueue = .main,
                handler: @escaping (Event) -> Void)

    Parameters

    userDefaults

    The user defaults object to monitor.

    options

    The options that specify which events to monitor. By default, all events are monitored.

    queue

    The operation queue on which the handler executes. By default, the main operation queue is used.

    handler

    The handler to call when the user defaults object is changed within the current process or more data is stored in the object than is allowed.

  • Initializes a new UserDefaultsMonitor.

  • The user defaults object being monitored.

    Declaration

    Swift

    public let userDefaults: UserDefaults
  • Declaration

    Swift

    public override func addNotificationObservers()