Giter Club home page Giter Club logo

Comments (5)

portellaa avatar portellaa commented on September 23, 2024 3

I did something like this:

extension ViewProxy {
    var safeArea: SupportsPositioningLayoutProxy {
        if #available(iOS 11.0, *) {
            return safeAreaLayoutGuide
        } else {
            return self
        }
    }
}

It's not the best solution or the most elegant one, but it's better than spreading if @available through all the code.

Just an idea 😅 😇

from cartography.

valexa avatar valexa commented on September 23, 2024

Precisely !?

from cartography.

corujautx avatar corujautx commented on September 23, 2024

iPhone X in landscape mode has different guides for left, right, leading and trailing. Do you mean as making the old API available again and using it as a proxy to safe area's top and bottom automatically? I mean, I think it's good but it'd need quite a bit of refactoring as the logic is different.
When you pin to a safeAreaLayoutGuide, you match .top to .top, where as by using one of the UILayoutSupport guides you'd usually match the .top of a view to the .bottom of the guide, and vice-versa.

from cartography.

Tylerian avatar Tylerian commented on September 23, 2024

Yes, that's exactly what I meant. It would save us a lot of boilerplate code when defining UILayoutGuide related constraints.

from cartography.

portellaa avatar portellaa commented on September 23, 2024

just opened a PR 👉 #301

from cartography.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.