Skip to content

Commit

Permalink
Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Aug 8, 2023
1 parent ad8951b commit 40a4a0a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Sources/Components/Compositions/PaddingNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ open class PaddingNode<Content: ASDisplayNode>: ASDisplayNode {

public let content: Content
public let padding: UIEdgeInsets


@available(*, deprecated, message: "Use init(padding:content:)")
public init(padding: UIEdgeInsets, child: () -> Content) {
let content = child()
self.content = content
self.padding = padding
super.init()
addSubnode(content)
}


public init(padding: UIEdgeInsets, content: Content) {
self.content = content
self.padding = padding
super.init()
addSubnode(content)
}

public final override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {

return ASInsetLayoutSpec(insets: padding, child: content)
Expand Down

0 comments on commit 40a4a0a

Please sign in to comment.