Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fall back device size #89

@mickamy

Description

@mickamy

Apple releases new devices each year(sometimes some season), and it force this library to release new version whenever new size of device came out.

When it comes to device size, most of people expect this lib to do its best effort, I think.

So I'd like to propose Device.size to return the nearest size as long as they know in the released version.

Once my proposal accepted, Device.size would be implemented like below.

    static public func size() -> Size {
        / * bra bra bra * /
        switch screenHeight {
            case 0...480:
                return .screen3_5Inch
            case 481...568:
                return .screen4Inch
            case 569...667:
                return UIScreen.main.scale == 3.0 ? .screen5_5Inch : .screen4_7Inch
            case 668...736:
                return .screen5_5Inch
           /* and so on... */

What do you people think about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions