- 
                Notifications
    
You must be signed in to change notification settings  - Fork 199
 
Open
Description
Let say I want to pin my subview to parent's layout margin guide. I have to write:
let stackView = UIStackView(arrangedSubviews: buttons)
[...]
contentView.addSubview(stackView)
stackView.topToSuperview(contentView.layoutMarginsGuide.topAnchor)
stackView.leftToSuperview(contentView.layoutMarginsGuide.leftAnchor)
stackView.rightToSuperview(contentView.layoutMarginsGuide.rightAnchor)
stackView.bottomToSuperview(contentView.layoutMarginsGuide.bottomAnchor)
Which is not convenient. If I wanted to pin it to parent's safe guide, I would just write:
stackView.edgesToSuperview(usingSafeArea: true)
It would be amazing to be able to do the same for margin guide.
May be an enum like:
enum LayoutGuide {
    case safeArea
    case margins
}
[...]
stackView.edgesToSuperview(using: .margins)
🙏
Metadata
Metadata
Assignees
Labels
No labels