Skip to content

Commit

Permalink
✨ Add View+FrameSize
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasackee committed Dec 6, 2024
1 parent 336fe80 commit 4a2e397
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Sources/ACKategories/SwiftUIExtensions/View+FrameSize.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import SwiftUI

@available(iOS 13, *)
extension View {

public func frame(size: CGSize) -> some View {
assert(size.width.isFinite)
assert(size.width >= 0)
assert(size.height.isFinite)
assert(size.height >= 0)
return frame(width: size.width, height: size.height)
}

public func frame(size: CGSize, alignment: Alignment) -> some View {
frame(width: size.width, height: size.height, alignment: alignment)
}
}

0 comments on commit 4a2e397

Please sign in to comment.