View
public protocol View : TypeErasedView
A type that represents part of your app’s user interface and provides modifiers that you use to configure views.
You create custom views by declaring types that conform to the View
protocol. Implement the required body
computed property to provide the content for your custom view.
-
The type of the
body
property defining the subtree ofView
s of thisView
.Declaration
Swift
associatedtype Body : View
-
body
Default implementationThe body property is used to delegate the generation of html for a specific node to another view. It should be set for all view which enclose other views in order to allow the layout system to propagate properties properly through the tree.
Default Implementation
Declaration
Swift
var body: Body { get }
-
font(_:
Extension method) Undocumented
Declaration
Swift
public func font(_ font: Font) -> some View
-
layoutAxis
Extension methodDeclaration
Swift
var layoutAxis: LayoutAxis { get }
-
html(forHTMLOfSubnodes:
Extension method) -
mapBody(_:
Extension method) Declaration
Swift
public func mapBody<T>(_ transform: (TypeErasedView) -> T) -> [T]
-
map(_:
Extension method) Declaration
Swift
public func map<T>(_ transform: (TypeErasedView) -> T) -> [T]
-
cornerRadius(_:
Extension method) Undocumented
Declaration
Swift
func cornerRadius(_ radius: Double) -> some View
-
shadow(color:
Extension methodradius: x: y: ) -
padding(_:
Extension method_: ) Undocumented
Declaration
Swift
func padding(_ edges: Edge.Set = .all, _ length: Double? = nil) -> some View
-
padding(_:
Extension method) Undocumented
Declaration
Swift
func padding(_ length: Double? = nil) -> some View
-
border(_:
Extension methodwidth: ) Undocumented
Declaration
Swift
func border(_ color: Color, width: Double = 1) -> some View
-
disabled(_:
Extension method) Undocumented
Declaration
Swift
func disabled(_ disabled: Bool) -> some View
-
foregroundColor(_:
Extension method) Undocumented
Declaration
Swift
func foregroundColor(_ color: Color?) -> some View
-
frame(width:
Extension methodheight: minWidth: minHeight: ) Undocumented
Declaration
Swift
func frame(width: Double? = nil, height: Double? = nil, minWidth: Double? = nil, minHeight: Double? = nil) -> some View
-
globalOverlay(_:
Extension method) Undocumented
Declaration
Swift
func globalOverlay<Overlay>(@ViewBuilder _ overlay: () -> Overlay) -> some View where Overlay : View
-
navigationBarTitle(_:
Extension methoddisplayMode: ) Undocumented
Declaration
Swift
func navigationBarTitle(_ title: String, displayMode: NavigationBarItem.TitleDisplayMode = .automatic) -> some View
-
navigationBarItems(trailing:
Extension method) Undocumented
Declaration
Swift
func navigationBarItems<T>(trailing: T) -> some View where T : View
-
onPreferenceChange(_:
Extension methodperform: ) Undocumented
Declaration
Swift
func onPreferenceChange<K>(_ key: K.Type = K.self, perform action: @escaping (K.Value) -> Void) -> some View where K : PreferenceKey
-
preference(key:
Extension methodvalue: ) Undocumented
Declaration
Swift
func preference<K>(key _: K.Type = K.self, value: K.Value) -> some View where K : PreferenceKey
-
sheet(isPresented:
Extension methodcontent: ) Undocumented
Declaration
Swift
func sheet<Content>(isPresented: Binding<Bool>, @ViewBuilder content: () -> Content) -> some View where Content : View
-
tabItem(_:
Extension method) Undocumented
Declaration
Swift
func tabItem<V>(@ViewBuilder _ label: () -> V) -> some View where V : View
-
tag(_:
Extension method) Undocumented
Declaration
Swift
func tag<V>(_ tag: V) -> some View where V : Hashable
-
onTapGesture(perform:
Extension method) Undocumented
Declaration
Swift
func onTapGesture(perform action: @escaping () -> Void) -> some View
-
keyboardType(_:
Extension method) Undocumented
Declaration
Swift
func keyboardType(_ type: UIKeyboardType) -> some View
-
background(_:
Extension method) Undocumented
Declaration
Swift
func background<Background>(_ background: Background) -> some View where Background : View