Created
June 16, 2016 00:50
-
-
Save orkoden/59ad4d67dff71d60a26da539d6f280b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# StackView Tips | |
## Performance hack | |
### Old hack | |
Use a UITableViewCell's contentview. The layout will not bubble up from here. Keeps all layout restriced to that view. | |
Then set frame of cell. | |
### New Hack | |
Use a UIStackView, but don't use arranged Stackviews. | |
It has a special layer. | |
Add views directly as subviews and add your own constraints. | |
## Debugging, General Tips | |
- Give identifiers to constraints | |
- Avoid changing constraints | |
- Don't use updateConstraints to throw away all constraints and add them again. | |
- Change constraints as little as possible | |
- Use `[UIView _layoutDebugginIdentifier]` to identify view. Don't ship this though! | |
# Fastest order for updating constraints | |
Order of constraint changes affects speed. This is the fastest order. | |
Do deactivation in this order, then activate in the same order. | |
1. Required inequlities | |
2. Required equalities | |
3. Optional inequlities | |
4. Optional equalities | |
5. Constant Changes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment