Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back device size #89

Open
mickamy opened this issue Oct 17, 2019 · 0 comments
Open

Fall back device size #89

mickamy opened this issue Oct 17, 2019 · 0 comments

Comments

@mickamy
Copy link
Contributor

mickamy commented Oct 17, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant