Skip to content

Instantly share code, notes, and snippets.

@VB10
Created September 14, 2022 22:07
Show Gist options
  • Save VB10/8c6a0a3afcb2f10cda37bbbee448dbe4 to your computer and use it in GitHub Desktop.
Save VB10/8c6a0a3afcb2f10cda37bbbee448dbe4 to your computer and use it in GitHub Desktop.
Edge instets with copywith
extension EdgeInsets {
func copyWith(top: CGFloat? = nil, leading: CGFloat? = nil, bottom: CGFloat? = nil, trailing: CGFloat? = nil) -> EdgeInsets {
return EdgeInsets.init(top: top ?? self.top, leading: leading ?? self.leading, bottom: bottom ?? self.bottom, trailing: trailing ?? self.trailing)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment