-
Notifications
You must be signed in to change notification settings - Fork 525
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
Adding support to UILayoutGuide #269
Merged
Merged
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2732065
Adding support to UILayoutGuide in Cartography
corujautx 462273b
Removing elements from constrain method signature
corujautx 6bcf956
Adding tests for LayoutGuide support
corujautx 6421a8c
Adding convenience support to safeAreaLayoutGuide
corujautx 6729905
Fixing documentation replacing references to view
corujautx a91c01a
Merge pull request #1 from corujautx/feature/layout-guide-support
corujautx b6eb9c9
Changing access control of proxy properties
corujautx e48af31
Fixing issues with macOS
corujautx bcf9c93
Fixing issue with top margin
corujautx a31a7e2
Removing baseline properties from layout guide proxy
corujautx 878f609
Removing IUOs & adding type-erasure
corujautx 1bb14b9
Adding safeAreaLayoutGuide tests
corujautx e4585a3
Renaming `LayoutElement` to `LayoutItem`
corujautx f2a8b73
Fixing type-erasures not being linked for the macOS target
corujautx 767821e
Merge branch 'master' of https://github.com/robb/Cartography
corujautx 5cd25b2
Fixing autoresizing mask to match older behavior
corujautx 4cdc8fa
Fixing generation of view proxies
corujautx 143d9fc
Fixing issue with Context not disabling autoresizing mask translation
corujautx da5e483
Changing podspec version to 3.0.0
corujautx fc476fe
Adding AutoresizingMaskLayoutProxy to macOS and tvOS targets
corujautx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// AutoresizingMaskLayoutProxy.swift | ||
// Cartography-iOS | ||
// | ||
// Created by Vitor Travain on 24/10/17. | ||
// Copyright © 2017 Robert Böhnke. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol AutoresizingMaskLayoutProxy: LayoutProxy { | ||
var translatesAutoresizingMaskIntoConstraints: Bool { get set } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 767821e...da5e483, why did
translatesAutoresizingMaskIntoConstraints = false
move to other methods?It seems scattered than before 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry about that.
Here's the problem tho: this introduces a bug/breaking change on the library depending on how people use it, and I kinda discovered that by pointing out my fork to a project we are developing at our company.
When I centralized the
translatesAutoresizingMaskIntoConstraints
in the proxy generation step I was thinking "Hey this is going to make the library a lot more simple", but the issue is that lot of people use the syntax as in:instead of:
in order to avoid IUOs
When we moved to the proxy code, the first case generated a side effect of setting up
translatesAutoresizingMaskIntoConstraints
in the superview, and this broke the layout of several root views inUINavigationController
or any container view controller.I couldn't predict this side effect being generated by the code I made, so I changed back into the original behavior of the library, even if it looks ugly, to avoid more breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation!
So,
translatesAutoresizingMaskIntoConstraints = false
impl is actually back to the original code now 🙄