Skip to content

Get the current device, in a static way #130

Description

@phimage

I am wondering if there is any reason why there is no shared instance, like UIDevice could have one named current

Could I PR this? (or you can add it)

extension Device {
    /// Return the current device instance.
    public static let current = Device()
}

ps: static variable seems to be lazy loaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions