Skip to content

Commit

Permalink
feat: add swiftui extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Apr 24, 2021
1 parent 5b25127 commit e3fae25
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Sources/ExtensionKit/SwiftUI/View.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import SwiftUI

@available(iOS 13.0, *)
public extension View {

/// Fill parent view
/// - Parameter alignment: alignment
/// - Returns: View with filled frame
func fillParent(alignment: Alignment = .center) -> some View {
self
.frame(
minWidth: 0,
maxWidth: .infinity,
minHeight: 0,
maxHeight: .infinity,
alignment: alignment
)
}

}

0 comments on commit e3fae25

Please sign in to comment.