Comments (5)
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.
Precisely !?
from cartography.
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.
Yes, that's exactly what I meant. It would save us a lot of boilerplate code when defining UILayoutGuide
related constraints.
from cartography.
just opened a PR 👉 #301
from cartography.
Related Issues (20)
- Create new release to include recent updates HOT 1
- How do I have the status bar visible and yet have the topView functional? HOT 2
- Invalid redeclaration of '~', Xcode 9.4.1, swift 4.1, pod 'Cartography' HOT 3
- NSLayoutConstraints.Attribute & .Relation HOT 1
- Issues building the latest version HOT 3
- no is ios
- Publish v3.1.0 to Cocoapods? HOT 1
- Swift5 HOT 1
- Xcode 11 beta build error HOT 4
- Mac Catalyst issues HOT 3
- xcode11,swift 4 ---Header 'Cartography-Swift.h' not found HOT 1
- How to use multiply
- Xcode12.1 deprecated warning
- Cartography is still awesome 2021-01
- Question: Is this project still active? HOT 2
- Build is not working
- speed of == operator overload HOT 1
- Namespace collision with SwiftUI 'View' HOT 1
- target '<Your Target Name>' do pod 'Cartography', '~> 3.0' end HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cartography.