Skip to content

Instantly share code, notes, and snippets.

@ahmedk92
Last active June 3, 2020 13:14
Show Gist options
  • Save ahmedk92/7f4e25261cd2671f1e96ece8c3587952 to your computer and use it in GitHub Desktop.
Save ahmedk92/7f4e25261cd2671f1e96ece8c3587952 to your computer and use it in GitHub Desktop.
Add padding to UIStackView
import UIKit
extension UIStackView {
var padding: NSDirectionalEdgeInsets {
get {
isLayoutMarginsRelativeArrangement ? directionalLayoutMargins : .zero
}
set {
isLayoutMarginsRelativeArrangement = true
directionalLayoutMargins = newValue
}
}
}
@ahmedk92
Copy link
Author

ahmedk92 commented Jun 3, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment